Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 23 additions & 26 deletions .github/workflows/repack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading