devbox/.github/workflows/release.yml
shoemoney 9b1165a49a
Some checks are pending
CI / vet-build-test (push) Waiting to run
feat(release): arm64/arm targets + Forgejo release one-shot + CI workflows 📦🤖
- build-release.sh: add linux/arm64 (Raspberry Pi!) + linux/arm targets — the
  curl|sh install on a clean Pi needs a real arm64 asset to download.
- scripts/release.sh: one-shot local release. Cross-compiles, then creates/updates
  the Forgejo release and uploads de-versioned assets (devbox_<os>_<arch>) that
  install.sh fetches directly. No CI runner required.
- .forgejo + .github CI workflows: go vet + build + test -race on push/PR;
  on vX.Y.Z tag, build-release + publish. GitHub's runs on hosted runners today.
- docker-compose: pull the published hub image by default; --build for local source.
2026-06-23 13:31:54 -05:00

41 lines
1.3 KiB
YAML

# On `vX.Y.Z` tag push: cross-compile every target and attach installer-named
# assets to a GitHub release (mirror of the Forgejo release). Point install.sh at
# this with DEVBOX_RELEASE_URL=https://github.com/<owner>/devbox/releases/download/<tag>.
name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Build all targets
run: VERSION="${{ github.ref_name }}" ./scripts/build-release.sh
- name: De-version asset names (match install.sh)
run: |
cd dist
for f in devbox_*_* devbox-hub_*_*; do
[ -f "$f" ] || continue
ext=""; case "$f" in *.exe) ext=".exe"; f="${f%.exe}";; esac
arch="${f##*_}"; rest="${f%_*}"; os="${rest##*_}"; bin="${rest%_*}"; bin="${bin%_*}"
mv "$f$ext" "${bin}_${os}_${arch}${ext}"
done
ls -la
- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" dist/* \
--title "${{ github.ref_name }}" \
--generate-notes