Files
routstrd/.github/workflows/release.yml
T
hzrd149GitHubhzrd149, redshift <213178690+1ftredsh@users.noreply.github.com>
d3749d4638 feat: add standalone binary releases (#89)
* feat: add standalone binary releases

* fix: propagate async CLI failures

* fix: detect older Bun standalone builds

* fix: constrain npm package contents

* fix: preserve npm daemon entrypoint

* fix: compare prerelease versions correctly

* fix: verify daemon ownership before update restart

* docs: add release and PM2 migration guidance

* ci: validate standalone builds before release

* chore: prepare v0.4.9 release

---------

Co-authored-by: hzrd149, redshift <213178690+1ftredsh@users.noreply.github.com>
2026-09-08 15:23:36 +00:00

111 lines
3.1 KiB
YAML

name: Release
on:
pull_request:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- run: bun install --frozen-lockfile
- name: Verify tag version
if: startsWith(github.ref, 'refs/tags/v')
run: |
package_version="$(bun -p "require('./package.json').version")"
test "${GITHUB_REF_NAME}" = "v${package_version}"
- run: bun run lint
- run: bun test
build:
needs: validate
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
target: bun-linux-x64
platform: linux
arch: x64
- runner: ubuntu-24.04-arm
target: bun-linux-arm64
platform: linux
arch: arm64
- runner: macos-15-intel
target: bun-darwin-x64
platform: darwin
arch: x64
- runner: macos-15
target: bun-darwin-arm64
platform: darwin
arch: arm64
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- run: bun install --frozen-lockfile
- name: Build standalone executable
run: >-
bun build --compile
--target=${{ matrix.target }}
--no-compile-autoload-dotenv
--no-compile-autoload-bunfig
src/index.ts
--outfile=build/routstrd
- name: Smoke test executable
run: |
package_version="$(bun -p "require('./package.json').version")"
test "$(build/routstrd --version)" = "${package_version}"
build/routstrd --help >/dev/null
- name: Package executable
run: |
package_version="$(bun -p "require('./package.json').version")"
tar -C build -czf \
"routstrd-v${package_version}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz" \
routstrd
- uses: actions/upload-artifact@v4
with:
name: routstrd-${{ matrix.platform }}-${{ matrix.arch }}
path: routstrd-*.tar.gz
if-no-files-found: error
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: routstrd-*
merge-multiple: true
- name: Create checksums
run: shasum -a 256 routstrd-*.tar.gz > SHA256SUMS
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release create "${GITHUB_REF_NAME}"
routstrd-*.tar.gz SHA256SUMS
--repo "${GITHUB_REPOSITORY}"
--verify-tag
--generate-notes
--title "${GITHUB_REF_NAME}"