chore: bump version #103
Workflow file for this run
This file contains hidden or 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 | |
| env: | |
| BUN_VERSION: 1.4.0 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: linux-x64 | |
| os: ubuntu-latest | |
| - name: linux-arm64 | |
| os: ubuntu-24.04-arm | |
| - name: darwin-x64 | |
| os: macos-26-intel | |
| - name: darwin-arm64 | |
| os: macos-26 | |
| - name: windows-x64 | |
| os: windows-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Install dependencies | |
| run: bun ci | |
| - name: Build executable | |
| run: bun run build | |
| - name: Package artifact | |
| shell: bash | |
| run: | | |
| case "${{ matrix.name }}" in | |
| linux-*) | |
| ZSTD_CLEVEL=19 tar --zstd -cf "dist/pi-ui-${{ matrix.name }}.tar.zst" -C dist pi-ui | |
| ;; | |
| darwin-*) | |
| (cd dist && ditto -c -k --keepParent pi-ui "pi-ui-${{ matrix.name }}.zip") | |
| ;; | |
| windows-*) | |
| (cd dist && 7z a "pi-ui-${{ matrix.name }}.zip" pi-ui.exe) | |
| ;; | |
| esac | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: dist/pi-ui-${{ matrix.name }}.* | |
| publish: | |
| name: Publish release and packages | |
| if: github.event_name == 'push' | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| path: dist | |
| - name: Flatten artifacts | |
| run: | | |
| find dist -mindepth 2 -type f -exec mv {} dist/ \; | |
| find dist -mindepth 1 -type d -empty -delete | |
| ls -lh dist | |
| - name: Generate release notes | |
| shell: bash | |
| run: | | |
| previous_tag=$(git describe --tags --match "v[0-9]*" --abbrev=0 "${GITHUB_REF_NAME}^" 2>/dev/null || true) | |
| repository_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" | |
| { | |
| echo "### What's Changed" | |
| echo | |
| if [[ -n "$previous_tag" ]]; then | |
| git log --reverse --format="- %s [\`%h\`](${repository_url}/commit/%H)" "${previous_tag}..${GITHUB_REF_NAME}" | |
| echo | |
| echo "**Full Changelog:** [${previous_tag}...${GITHUB_REF_NAME}](${repository_url}/compare/${previous_tag}...${GITHUB_REF_NAME})" | |
| else | |
| git log --reverse --format="- %s [\`%h\`](${repository_url}/commit/%H)" "$GITHUB_REF_NAME" | |
| fi | |
| } > /tmp/release-notes.md | |
| - name: GitHub release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: dist/* | |
| body_path: /tmp/release-notes.md | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Install npm package dependencies | |
| run: bun ci | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| - name: Publish npm package | |
| run: npm publish | |
| - name: Compute checksums | |
| id: sha | |
| run: | | |
| { | |
| echo "linux-x64=$(sha256sum dist/pi-ui-linux-x64.tar.zst | cut -d' ' -f1)" | |
| echo "linux-arm64=$(sha256sum dist/pi-ui-linux-arm64.tar.zst | cut -d' ' -f1)" | |
| echo "darwin-x64=$(sha256sum dist/pi-ui-darwin-x64.zip | cut -d' ' -f1)" | |
| echo "darwin-arm64=$(sha256sum dist/pi-ui-darwin-arm64.zip | cut -d' ' -f1)" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Generate Homebrew formula | |
| run: | | |
| V="${GITHUB_REF_NAME#v}" | |
| sed -e "s/{{VERSION}}/$V/g" \ | |
| -e "s/{{SHA_DARWIN_X64}}/${{ steps.sha.outputs.darwin-x64 }}/g" \ | |
| -e "s/{{SHA_DARWIN_ARM64}}/${{ steps.sha.outputs.darwin-arm64 }}/g" \ | |
| packaging/homebrew/pi-ui.rb.in > /tmp/pi-ui.rb | |
| - name: Push Homebrew formula | |
| env: | |
| GH_PAT: ${{ secrets.GH_PAT }} | |
| run: | | |
| git clone "https://x-access-token:${GH_PAT}@github.com/hyperpuncher/homebrew-tap.git" /tmp/homebrew-tap | |
| mkdir -p /tmp/homebrew-tap/Formula | |
| cp /tmp/pi-ui.rb /tmp/homebrew-tap/Formula/pi-ui.rb | |
| rm -f /tmp/homebrew-tap/Formula/pi-ui-server.rb /tmp/homebrew-tap/Casks/pi-ui.rb | |
| test -f /tmp/homebrew-tap/formula_renames.json || echo '{}' > /tmp/homebrew-tap/formula_renames.json | |
| jq '. + {"pi-ui-server": "pi-ui"}' /tmp/homebrew-tap/formula_renames.json > /tmp/formula_renames.json | |
| mv /tmp/formula_renames.json /tmp/homebrew-tap/formula_renames.json | |
| cd /tmp/homebrew-tap | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git add -A Formula Casks formula_renames.json | |
| git diff --staged --quiet || git commit -m "pi-ui: renamed from pi-ui-server" | |
| git push | |
| - name: Generate AUR package | |
| run: | | |
| V="${GITHUB_REF_NAME#v}" | |
| LICENSE_SHA=$(sha256sum LICENSE | cut -d' ' -f1) | |
| sed -e "s/{{VERSION}}/$V/g" \ | |
| -e "s/{{SHA_LICENSE}}/$LICENSE_SHA/g" \ | |
| -e "s/{{SHA_LINUX_X64}}/${{ steps.sha.outputs.linux-x64 }}/g" \ | |
| -e "s/{{SHA_LINUX_ARM64}}/${{ steps.sha.outputs.linux-arm64 }}/g" \ | |
| packaging/aur/PKGBUILD.in > /tmp/PKGBUILD | |
| docker run --rm --interactive archlinux:base-devel bash -c ' | |
| useradd --create-home builder | |
| cat > /home/builder/PKGBUILD | |
| chown builder:builder /home/builder/PKGBUILD | |
| cd /home/builder | |
| runuser --user builder -- makepkg --printsrcinfo | |
| ' < /tmp/PKGBUILD > /tmp/.SRCINFO | |
| - name: Push AUR package | |
| env: | |
| AUR_KEY: ${{ secrets.AUR_KEY }} | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "$AUR_KEY" > ~/.ssh/aur_key | |
| chmod 600 ~/.ssh/aur_key | |
| ssh-keyscan -t ed25519,rsa aur.archlinux.org >> ~/.ssh/known_hosts | |
| export GIT_SSH_COMMAND="ssh -i ~/.ssh/aur_key" | |
| git clone ssh://aur@aur.archlinux.org/pi-ui-bin.git /tmp/aur-repo | |
| cp /tmp/PKGBUILD /tmp/aur-repo/PKGBUILD | |
| cp /tmp/.SRCINFO /tmp/aur-repo/.SRCINFO | |
| cp LICENSE /tmp/aur-repo/LICENSE | |
| cd /tmp/aur-repo | |
| git config user.name "hyperpuncher" | |
| git config user.email "hyperpuncher@users.noreply.github.com" | |
| git add PKGBUILD .SRCINFO LICENSE | |
| git diff --staged --quiet || git commit -m "upgpkg: pi-ui-bin ${GITHUB_REF_NAME#v}" | |
| git push |