Skip to content

Commit 190c874

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 0d6b71f commit 190c874

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
GH_REPO: ${{ (github.ref_name == 'beta' && 'anomalyco/opencode-beta') || github.repository }}
7467
outputs:
7568
version: ${{ steps.version.outputs.version }}
@@ -612,17 +605,21 @@ jobs:
612605

613606
- uses: ./.github/actions/setup-bun
614607

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

622617
- name: Set up QEMU
618+
if: needs.version.outputs.release
623619
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
624620

625621
- name: Set up Docker Buildx
622+
if: needs.version.outputs.release
626623
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
627624

628625
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -703,7 +700,9 @@ jobs:
703700
opencode-app-id: ${{ vars.OPENCODE_APP_ID }}
704701
opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }}
705702

703+
# Only releases publish to AUR and Homebrew and make release commits, which use the git identity set below.
706704
- name: Cache apt packages (AUR)
705+
if: needs.version.outputs.release
707706
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
708707
with:
709708
path: /var/cache/apt/archives
@@ -712,6 +711,7 @@ jobs:
712711
${{ runner.os }}-apt-aur-
713712
714713
- name: Setup SSH for AUR
714+
if: needs.version.outputs.release
715715
run: |
716716
sudo apt-get update
717717
sudo apt-get install -y pacman-package-manager

0 commit comments

Comments
 (0)