Skip to content

Merge pull request #39 from InverterNetwork/dev #8

Merge pull request #39 from InverterNetwork/dev

Merge pull request #39 from InverterNetwork/dev #8

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.9
- run: bun install --frozen-lockfile
- name: Build Admin UI
run: bun run admin-ui:build
- run: bun test
- run: bun run typecheck
- name: Build binaries
env:
QUAY_VERSION: ${{ github.ref_name }}
QUAY_UI_DIST_DIR: ${{ github.workspace }}/packages/admin-ui/dist
run: |
bun run --cwd packages/cli scripts/embed.ts
bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --target=bun-linux-x64 packages/cli/src/cli/index.ts --outfile dist/quay-linux-amd64
bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --target=bun-linux-arm64 packages/cli/src/cli/index.ts --outfile dist/quay-linux-arm64
bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --target=bun-darwin-x64 packages/cli/src/cli/index.ts --outfile dist/quay-darwin-amd64
bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --target=bun-darwin-arm64 packages/cli/src/cli/index.ts --outfile dist/quay-darwin-arm64
- name: Smoke test linux-amd64 binary
run: |
version="$(./dist/quay-linux-amd64 --version)"
case "$version" in
"${GITHUB_REF_NAME}+"*) ;;
*) echo "expected ${GITHUB_REF_NAME}+<sha>, got ${version}"; exit 1 ;;
esac
tmp="$(mktemp -d)"
QUAY_DATA_DIR="$tmp/data" ./dist/quay-linux-amd64 serve --port 19731 > "$tmp/serve.out" 2> "$tmp/serve.err" &
pid="$!"
trap 'kill "$pid" 2>/dev/null || true' EXIT
for _ in $(seq 1 50); do
if curl -fsS http://127.0.0.1:19731/ > "$tmp/index.html"; then
break
fi
sleep 0.1
done
grep -q '<div id="root"></div>' "$tmp/index.html"
kill "$pid"
wait "$pid" 2>/dev/null || true
trap - EXIT
- name: Generate checksums
working-directory: dist
run: sha256sum quay-* > SHA256SUMS
- name: Create release
run: |
gh release create "${GITHUB_REF_NAME}" \
--generate-notes \
dist/quay-* dist/SHA256SUMS