Skip to content

Commit d524a78

Browse files
committed
add github workflows
1 parent b8b564a commit d524a78

File tree

4 files changed

+123
-0
lines changed

4 files changed

+123
-0
lines changed

.github/release-drafter.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
labels:
6+
- 'feature'
7+
- 'enhancement'
8+
- title: '🐛 Bug Fixes'
9+
labels:
10+
- 'fix'
11+
- 'bugfix'
12+
- 'bug'
13+
- title: '🧰 Maintenance'
14+
label: 'chore'
15+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
16+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
17+
template: |
18+
## Changes
19+
20+
$CHANGES
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Push Docker Image on Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
20+
21+
- name: Log in to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Extract release tag
29+
id: tag
30+
run: echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
31+
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@v5
34+
with:
35+
context: .
36+
push: true
37+
tags: |
38+
ghcr.io/a7d-corp/apple-health-ingester:${{ github.event.release.tag_name }}
39+
ghcr.io/a7d-corp/apple-health-ingester:latest
40+
cache-from: type=gha
41+
cache-to: type=gha,mode=max
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- main
8+
- master
9+
pull_request:
10+
types: [opened, reopened, synchronize]
11+
permissions:
12+
contents: read
13+
jobs:
14+
update_release_draft:
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: release-drafter/release-drafter@v6
21+
with:
22+
config-name: release-drafter.yaml
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Update changelog
2+
on:
3+
release:
4+
types: [released]
5+
6+
jobs:
7+
debug_info:
8+
name: Debug info
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- name: Print github context JSON
12+
run: |
13+
cat <<EOF
14+
${{ toJson(github) }}
15+
EOF
16+
17+
update-changelog:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v6
24+
with:
25+
ref: ${{ github.event.release.target_commitish }}
26+
token: ${{ secrets.GH_TOKEN }}
27+
- name: Update CHANGELOG
28+
uses: stefanzweifel/changelog-updater-action@v1
29+
with:
30+
latest-version: ${{ github.event.release.tag_name }}
31+
release-notes: ${{ github.event.release.body }}
32+
- name: Commit updated CHANGELOG
33+
uses: stefanzweifel/git-auto-commit-action@v7
34+
with:
35+
branch: ${{ github.event.release.target_commitish }}
36+
commit_message: Update CHANGELOG
37+
file_pattern: CHANGELOG.md
38+
token: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)