Skip to content

Commit 509dd7e

Browse files
committed
chore(ci): skip release-only setup on dev publishes
The version job no longer clones the full history or installs the opencode CLI, and stops passing OPENCODE_API_KEY: script/version.ts stopped generating the changelog, so it only needs the checked-out branch name. The publish job sets up Docker, the AUR apt packages, the AUR SSH key and the release git identity only when a release is published, since Docker, AUR, Homebrew and the release commits only run then.
1 parent 177b3e5 commit 509dd7e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ jobs:
4646
if: github.repository == 'anomalyco/opencode'
4747
steps:
4848
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
49-
with:
50-
fetch-depth: 0
5149

5250
- uses: ./.github/actions/setup-bun
5351

@@ -58,18 +56,13 @@ jobs:
5856
opencode-app-id: ${{ vars.OPENCODE_APP_ID }}
5957
opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }}
6058

61-
- name: Install OpenCode
62-
if: inputs.bump || inputs.version
63-
run: bun i -g opencode-ai
64-
6559
- id: version
6660
run: |
6761
./script/version.ts
6862
env:
6963
GH_TOKEN: ${{ steps.committer.outputs.token }}
7064
OPENCODE_BUMP: ${{ inputs.bump }}
7165
OPENCODE_VERSION: ${{ inputs.version }}
72-
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
7366
outputs:
7467
version: ${{ steps.version.outputs.version }}
7568
release: ${{ steps.version.outputs.release }}
@@ -610,17 +603,21 @@ jobs:
610603

611604
- uses: ./.github/actions/setup-bun
612605

606+
# Only releases push the Docker image (packages/cli/script/publish.ts).
613607
- name: Login to GitHub Container Registry
608+
if: needs.version.outputs.release
614609
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
615610
with:
616611
registry: ghcr.io
617612
username: ${{ github.repository_owner }}
618613
password: ${{ secrets.GITHUB_TOKEN }}
619614

620615
- name: Set up QEMU
616+
if: needs.version.outputs.release
621617
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
622618

623619
- name: Set up Docker Buildx
620+
if: needs.version.outputs.release
624621
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
625622

626623
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -701,7 +698,9 @@ jobs:
701698
opencode-app-id: ${{ vars.OPENCODE_APP_ID }}
702699
opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }}
703700

701+
# Only releases publish to AUR and Homebrew and make release commits, which use the git identity set below.
704702
- name: Cache apt packages (AUR)
703+
if: needs.version.outputs.release
705704
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
706705
with:
707706
path: /var/cache/apt/archives
@@ -710,6 +709,7 @@ jobs:
710709
${{ runner.os }}-apt-aur-
711710
712711
- name: Setup SSH for AUR
712+
if: needs.version.outputs.release
713713
run: |
714714
sudo apt-get update
715715
sudo apt-get install -y pacman-package-manager

0 commit comments

Comments
 (0)