v0.0.10 #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Build | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: bun install | |
- name: Build distribution | |
run: bun run build-dist | |
- name: Create archives | |
run: | | |
cd dist | |
# Create archives for Linux builds (both .tar.xz and .zip) | |
for dir in linux-*; do | |
if [ -d "$dir" ]; then | |
tar -cJf "$dir.tar.xz" "$dir" # -J flag creates xz compression | |
zip -r "$dir.zip" "$dir" | |
fi | |
done | |
# Create only zip archives for other platforms | |
for dir in */; do | |
dir=${dir%/} | |
if [[ ! "$dir" == linux-* ]] && [ -d "$dir" ]; then | |
zip -r "$dir.zip" "$dir" | |
fi | |
done | |
- name: Get Latest Release Tag | |
if: github.event_name == 'workflow_dispatch' | |
id: get_latest_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
latest_tag=$(gh release list -L 1 --json tagName --jq '.[0].tagName') | |
echo "latest_tag=$latest_tag" >> "$GITHUB_OUTPUT" | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || steps.get_latest_release.outputs.latest_tag }} | |
run: | | |
for file in dist/*.{tar.xz,zip}; do | |
gh release upload "$RELEASE_TAG" "$file" --clobber | |
done |