diff --git a/.github/workflows/repack.yml b/.github/workflows/repack.yml index 5d41a5f..3194465 100644 --- a/.github/workflows/repack.yml +++ b/.github/workflows/repack.yml @@ -6,7 +6,27 @@ on: permissions: contents: read jobs: + release: + if: startsWith(github.ref, 'refs/tags/v') + runs-on: blacksmith-4vcpu-ubuntu-2404 + permissions: + contents: write + steps: + - name: The tag's release, for the builds to attach to + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + TAG: ${{ github.ref_name }} + run: | + # The release may already exist (published at the merge): the builds attach to it. + gh release view "$TAG" >/dev/null 2>&1 || + gh release create "$TAG" --title "OpenCode $TAG" --notes "Official OpenCode binaries, checksum-verified and repacked. See the repository README for upstream provenance." repack: + # after the release job on a tag; a manual run (no tag, so no release) builds and checks only + needs: release + if: ${{ !failure() && !cancelled() }} + permissions: + contents: write runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 15 strategy: @@ -21,33 +41,10 @@ jobs: - run: python3 -m unittest discover -s tests -v - name: Download pinned upstream archive and verify checksum run: python3 scripts/repack.py --target '${{ matrix.target }}' --download --output release - - uses: actions/upload-artifact@v4 - with: - name: opencode-${{ matrix.target }} - path: release/* - if-no-files-found: error - release: - if: startsWith(github.ref, 'refs/tags/v') - needs: repack - runs-on: blacksmith-4vcpu-ubuntu-2404 - permissions: - contents: write - steps: - - uses: actions/download-artifact@v4 - with: - pattern: opencode-* - merge-multiple: true - path: release - - name: Attach the repacked builds to the release + - name: Attach this build to the tag's release + if: startsWith(github.ref, 'refs/tags/v') env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} - TAG: ${{ github.ref_name }} run: | - # The release may already exist (published at the merge): attach to it - # rather than failing, whichever came first. - if gh release view "$TAG" >/dev/null 2>&1; then - gh release upload "$TAG" release/* --clobber - else - gh release create "$TAG" release/* --title "OpenCode $TAG" --notes "Official OpenCode binaries, checksum-verified and repacked. See the repository README for upstream provenance." - fi + gh release upload "${{ github.ref_name }}" release/* --clobber diff --git a/README.md b/README.md index d26fd35..c137047 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,11 @@ in the ordinary machine environment. The release installer uses this repository has `/opt/homebrew/bin/opencode`, version 2.2.1. Other platforms are unverified. No key form or vault secret is defined by this extension. -The repository has no published release yet. The artifact-only `repack.yml` -workflow downloads pinned official archives and produces node-compatible archives -plus checksums. It does not publish a release. The existing release-extension -workflow remains the publication path after review. See [UPSTREAM.md](UPSTREAM.md). +The `repack.yml` workflow downloads pinned official archives and produces +node-compatible archives plus checksums. On a `v*` tag each build attaches them +to the tag's release (made at the merge by the release-extension workflow, or by +`repack.yml` when it isn't there yet); a manual run only checks them. See +[UPSTREAM.md](UPSTREAM.md). ## A wake