Skip to content

Commit 2d93b4d

Browse files
committed
feat: enhance release workflow to include standalone Linux binary packaging and upload
1 parent a1c41b9 commit 2d93b4d

File tree

3 files changed

+155
-436
lines changed

3 files changed

+155
-436
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
repo: context.repo.repo,
2929
tag_name: tagName,
3030
name: `Fetch Github Hosts ${tagName}`,
31-
body: `See the assets below to download the app for your platform.\n\n**macOS**: \`.dmg\` (Universal binary - supports both Intel & Apple Silicon)\n**Windows**: \`.msi\` / \`.exe\`\n**Linux**: \`.deb\` / \`.AppImage\``,
31+
body: `See the assets below to download the app for your platform.\n\n**macOS**: \`.dmg\` (Universal binary - supports both Intel & Apple Silicon)\n**Windows**: \`.msi\` / \`.exe\`\n**Linux**: \`.deb\` / \`.AppImage\`\n**Linux Standalone Binary**: \`.tar.gz\` (amd64 / aarch64, no installation needed)`,
3232
draft: true,
3333
prerelease: false
3434
});
@@ -48,11 +48,16 @@ jobs:
4848
args: --target universal-apple-darwin
4949
rust_targets: aarch64-apple-darwin,x86_64-apple-darwin
5050
name: macos-universal
51-
# Linux
51+
# Linux x86_64
5252
- platform: ubuntu-22.04
5353
args: ''
5454
rust_targets: ''
5555
name: linux-x86_64
56+
# Linux ARM64
57+
- platform: ubuntu-22.04-arm
58+
args: ''
59+
rust_targets: ''
60+
name: linux-aarch64
5661
# Windows
5762
- platform: windows-latest
5863
args: ''
@@ -82,7 +87,7 @@ jobs:
8287
workspaces: './src-tauri -> target'
8388

8489
- name: Install system dependencies (Linux)
85-
if: matrix.platform == 'ubuntu-22.04'
90+
if: contains(matrix.name, 'linux')
8691
run: |
8792
sudo apt-get update
8893
sudo apt-get install -y \
@@ -112,3 +117,20 @@ jobs:
112117
with:
113118
releaseId: ${{ needs.create-release.outputs.release_id }}
114119
args: ${{ matrix.args }}
120+
121+
- name: Package standalone binary (Linux)
122+
if: contains(matrix.name, 'linux')
123+
run: |
124+
ARCH=$([[ "${{ matrix.name }}" == *"aarch64"* ]] && echo "aarch64" || echo "amd64")
125+
BINARY="src-tauri/target/release/fetch-github-hosts"
126+
TAR_NAME="fetch-github-hosts_linux_${ARCH}.tar.gz"
127+
tar -czf "$TAR_NAME" -C "$(dirname "$BINARY")" "$(basename "$BINARY")"
128+
echo "TAR_NAME=$TAR_NAME" >> "$GITHUB_ENV"
129+
130+
- name: Upload standalone binary (Linux)
131+
if: contains(matrix.name, 'linux')
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134+
run: |
135+
TAG_NAME=${GITHUB_REF#refs/tags/}
136+
gh release upload "$TAG_NAME" "$TAR_NAME" --repo "${{ github.repository }}" --clobber

0 commit comments

Comments
 (0)