Skip to content

Commit

Permalink
feat(publish-cli): Checkout repository at tagged version and bypass d…
Browse files Browse the repository at this point in the history
…iff checks

The changes in this commit address the following:

1. Checkout the repository at the tagged version to ensure the correct code is used for the release.
2. Bypass the diff checks when publishing to GitHub and Homebrew, as these checks are already performed in the "prepare" job.
  • Loading branch information
esolitos authored and gitbutler-client committed Sep 20, 2024
1 parent 82abdb6 commit e9d02c8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ jobs:
publish:
runs-on: macos-latest

# Publish the CLI only if changes were detected and the event was a push or workflow_dispatch.
if: needs.prepare.outputs.changes-detected == 'true' && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name)
# Publish if there are changes detected or if the workflow was manually triggered.
if: (github.event_name == 'push' && needs.prepare.outputs.changes-detected == 'true') || (github.event_name == 'workflow_dispatch')
needs:
- prepare
- build-test
Expand All @@ -130,9 +130,12 @@ jobs:
VERSION: ${{ needs.prepare.outputs.build-version }}

steps:
- uses: actions/checkout@v4
- name: Checkout Repository at tagged version
uses: actions/checkout@v4
with:
fetch-depth: 0
# Prefix the version with "v" to checkout the tag.
ref: "v${{ needs.prepare.outputs.build-version }}"

- uses: actions/download-artifact@v4
with:
Expand All @@ -151,13 +154,15 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
make clean dist-github
# Release to Github directly, bypassing the diff check as we already perform this check in the "prepare" job.
make -- --dist-github
- name: Publish to Homebrew
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
run: |
make clean dist-homebrew
# Release to Homebrew directly, bypassing the diff check as we already perform this check in the "prepare" job.
make -- --dist-homebrew
- name: Install via Homebrew
run: |
Expand Down

0 comments on commit e9d02c8

Please sign in to comment.