Skip to content

Commit 2bf33b0

Browse files
ci(release): add release-please and Linux ARM64 builds
Replace manual tag-based releases with release-please automation. Add release-please-action workflow to manage version bumps, changelog generation, and GitHub Release creation via conventional commits. Update release workflow to trigger on release:published instead of tag push. Switch tauri-action from creating draft releases to uploading artifacts to the release-please-created release via releaseId. Add build-linux-arm64 job using Docker Buildx + QEMU with existing Dockerfile to produce ARM64 .deb packages in CI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 81090a9 commit 2bf33b0

4 files changed

Lines changed: 106 additions & 21 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
release_created: ${{ steps.release.outputs.release_created }}
16+
tag_name: ${{ steps.release.outputs.tag_name }}
17+
steps:
18+
- uses: googleapis/release-please-action@v4
19+
id: release
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ on:
1313
- macos
1414
- linux
1515
- windows
16-
push:
17-
tags:
18-
- 'v*'
16+
release:
17+
types: [published]
1918

2019
permissions:
2120
contents: write
@@ -27,7 +26,9 @@ concurrency:
2726
jobs:
2827
build-macos:
2928
name: Build macOS (ARM64)
30-
if: inputs.platform == 'all' || inputs.platform == 'macos' || inputs.platform == ''
29+
if: >
30+
github.event_name == 'release' ||
31+
inputs.platform == 'all' || inputs.platform == 'macos' || inputs.platform == ''
3132
runs-on: [macOS, ARM64]
3233
timeout-minutes: 30
3334

@@ -72,11 +73,8 @@ jobs:
7273
LASTFM_API_KEY: ${{ secrets.LASTFM_API_KEY }}
7374
LASTFM_API_SECRET: ${{ secrets.LASTFM_API_SECRET }}
7475
with:
75-
tagName: v__VERSION__
76-
releaseName: 'mt v__VERSION__'
77-
releaseBody: 'See assets below to download and install.'
78-
releaseDraft: true
79-
prerelease: false
76+
tagName: ${{ github.event.release.tag_name }}
77+
releaseId: ${{ github.event.release.id }}
8078
args: --target aarch64-apple-darwin
8179
projectPath: './crates/mt-tauri'
8280

@@ -88,7 +86,9 @@ jobs:
8886
8987
build-linux-amd64:
9088
name: Build Linux (amd64)
91-
if: inputs.platform == 'all' || inputs.platform == 'linux' || inputs.platform == ''
89+
if: >
90+
github.event_name == 'release' ||
91+
inputs.platform == 'all' || inputs.platform == 'linux' || inputs.platform == ''
9292
runs-on: ubuntu-latest
9393
timeout-minutes: 30
9494

@@ -104,17 +104,54 @@ jobs:
104104
LASTFM_API_KEY: ${{ secrets.LASTFM_API_KEY }}
105105
LASTFM_API_SECRET: ${{ secrets.LASTFM_API_SECRET }}
106106
with:
107-
tagName: v__VERSION__
108-
releaseName: 'mt v__VERSION__'
109-
releaseBody: 'See assets below to download and install.'
110-
releaseDraft: true
111-
prerelease: false
107+
tagName: ${{ github.event.release.tag_name }}
108+
releaseId: ${{ github.event.release.id }}
112109
args: --target x86_64-unknown-linux-gnu --bundles deb
113110
projectPath: './crates/mt-tauri'
114111

112+
build-linux-arm64:
113+
name: Build Linux (ARM64)
114+
if: >
115+
github.event_name == 'release' ||
116+
inputs.platform == 'all' || inputs.platform == 'linux' || inputs.platform == ''
117+
runs-on: ubuntu-latest
118+
timeout-minutes: 60
119+
120+
steps:
121+
- uses: actions/checkout@v6
122+
123+
- name: Set up Docker Buildx
124+
uses: docker/setup-buildx-action@v3
125+
126+
- name: Set up QEMU
127+
uses: docker/setup-qemu-action@v3
128+
with:
129+
platforms: arm64
130+
131+
- name: Build ARM64 .deb
132+
run: |
133+
docker buildx build \
134+
--platform linux/arm64 \
135+
--file docker/Dockerfile.linux-arm64 \
136+
--build-arg LASTFM_API_KEY=${{ secrets.LASTFM_API_KEY }} \
137+
--build-arg LASTFM_API_SECRET=${{ secrets.LASTFM_API_SECRET }} \
138+
--target artifacts \
139+
--output type=local,dest=dist/linux-arm64 \
140+
.
141+
142+
- name: Upload ARM64 artifacts to release
143+
if: github.event_name == 'release'
144+
env:
145+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146+
run: |
147+
gh release upload "${{ github.event.release.tag_name }}" \
148+
dist/linux-arm64/*.deb
149+
115150
build-windows:
116151
name: Build Windows (x64)
117-
if: inputs.platform == 'all' || inputs.platform == 'windows' || inputs.platform == ''
152+
if: >
153+
github.event_name == 'release' ||
154+
inputs.platform == 'all' || inputs.platform == 'windows' || inputs.platform == ''
118155
runs-on: [self-hosted, Windows, X64]
119156
timeout-minutes: 45
120157

@@ -178,11 +215,8 @@ jobs:
178215
LASTFM_API_KEY: ${{ secrets.LASTFM_API_KEY }}
179216
LASTFM_API_SECRET: ${{ secrets.LASTFM_API_SECRET }}
180217
with:
181-
tagName: v__VERSION__
182-
releaseName: 'mt v__VERSION__'
183-
releaseBody: 'See assets below to download and install.'
184-
releaseDraft: true
185-
prerelease: false
218+
tagName: ${{ github.event.release.tag_name }}
219+
releaseId: ${{ github.event.release.id }}
186220
args: --target x86_64-pc-windows-msvc --bundles nsis --config "${{ env.SIGN_CONFIG_PATH }}"
187221
projectPath: './crates/mt-tauri'
188222

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

release-please-config.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "simple",
4+
"include-component-in-tag": false,
5+
"packages": {
6+
".": {
7+
"changelog-path": "CHANGELOG.md",
8+
"extra-files": [
9+
{
10+
"type": "toml",
11+
"path": "crates/mt-tauri/Cargo.toml",
12+
"jsonpath": "$.package.version"
13+
},
14+
{
15+
"type": "json",
16+
"path": "crates/mt-tauri/tauri.conf.json",
17+
"jsonpath": "$.version"
18+
},
19+
{
20+
"type": "json",
21+
"path": "app/frontend/package.json",
22+
"jsonpath": "$.version"
23+
}
24+
]
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)