Skip to content

app release

app release #20

Workflow file for this run

name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
jobs:
test:
uses: ./.github/workflows/test.yml
secrets: inherit
build-darwin:
needs: [test]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: desktop/go.mod
- uses: oven-sh/setup-bun@v2
- uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GH_PAT }}
- name: Install arm64 libfido2
run: brew install libfido2
- name: Install amd64 libfido2
run: |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew install libfido2 openssl@3
# go-libfido2 hardcodes openssl@1.1 paths in its static CGO directives
# (fido2_static_amd64.go has no build constraint so it's always compiled).
# Symlink openssl@3 to the expected openssl@1.1 location.
sudo ln -s /usr/local/opt/openssl@3 /usr/local/opt/openssl@1.1
- name: Install wails3
run: go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha.74
- name: Build with GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: build --clean -f .goreleaser-darwin.yml
workdir: desktop
- name: Package .app bundle
working-directory: desktop
run: |
# Copy universal binary to bin/ where task expects it
BINARY=$(find dist -name "Monban" -type f | head -1)
mkdir -p bin
cp "$BINARY" bin/Monban
task darwin:create:app:bundle
# Zip the .app
mkdir -p release
cd bin && zip -ry "../release/monban_macos_universal.zip" Monban.app
- name: Build .pkg installer
working-directory: desktop
run: |
# Strip leading "v" from tag to produce Monban-0.1.0.pkg style filename.
VERSION=${GITHUB_REF_NAME#v}
task darwin:pkg VERSION="$VERSION"
mkdir -p release
cp bin/Monban-*.pkg release/
- uses: actions/upload-artifact@v4
with:
name: darwin-artifacts
path: |
desktop/release/*.zip
desktop/release/*.pkg
build-linux-amd64:
needs: [test]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: desktop/go.mod
- uses: oven-sh/setup-bun@v2
- uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GH_PAT }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libfido2-dev libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Install wails3
run: go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha.74
- name: Build and package with GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --skip=publish --clean -f .goreleaser-linux-amd64.yml
workdir: desktop
- uses: actions/upload-artifact@v4
with:
name: linux-amd64-artifacts
path: |
desktop/dist/*.tar.gz
desktop/dist/*.deb
desktop/dist/*.rpm
desktop/dist/checksums_linux_amd64.txt
# NOTE: ubuntu-24.04-arm requires GitHub Actions ARM runners.
# Available free for public repos. For private repos, requires
# GitHub Team/Enterprise or self-hosted ARM runner.
build-linux-arm64:
needs: [test]
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: desktop/go.mod
- uses: oven-sh/setup-bun@v2
- uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GH_PAT }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libfido2-dev libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Install wails3
run: go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha.74
- name: Build and package with GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --skip=publish --clean -f .goreleaser-linux-arm64.yml
workdir: desktop
- uses: actions/upload-artifact@v4
with:
name: linux-arm64-artifacts
path: |
desktop/dist/*.tar.gz
desktop/dist/*.deb
desktop/dist/*.rpm
desktop/dist/checksums_linux_arm64.txt
release:
needs: [build-darwin, build-linux-amd64, build-linux-arm64]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Generate combined checksums
run: |
cd artifacts
cat checksums_linux_amd64.txt checksums_linux_arm64.txt > checksums.txt 2>/dev/null || true
sha256sum monban_*.zip >> checksums.txt 2>/dev/null || true
sha256sum Monban-*.pkg >> checksums.txt 2>/dev/null || true
rm -f checksums_linux_*.txt
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
gh release create "${{ github.ref_name }}" \
--title "Monban ${{ github.ref_name }}" \
--generate-notes \
artifacts/*
- name: Create Codeberg release
env:
CB_TOKEN: ${{ secrets.CB_PAT }}
TAG: ${{ github.ref_name }}
run: |
RELEASE_ID=$(curl -s -X POST \
-H "Authorization: token $CB_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"$TAG\", \"name\": \"Monban $TAG\", \"body\": \"See [GitHub release](https://github.com/flythenimbus/monban/releases/tag/$TAG) for full notes.\"}" \
"https://codeberg.org/api/v1/repos/flythenimbus/monban/releases" | jq -r '.id')
for file in artifacts/*; do
curl -s -X POST \
-H "Authorization: token $CB_TOKEN" \
-F "attachment=@$file" \
"https://codeberg.org/api/v1/repos/flythenimbus/monban/releases/$RELEASE_ID/assets"
done