Skip to content

Commit

Permalink
Determine args dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrower95 committed Aug 14, 2024
1 parent 51c3dc5 commit ef3e2a5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/cli_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
Expand All @@ -25,14 +23,20 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: stable
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- name: Determine Release Args
id: determine_args
run: |
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
echo "RELEASE_ARGS=release --clean" >> $GITHUB_ENV
else
echo "RELEASE_ARGS=release --snapshot" >> $GITHUB_ENV
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --snapshot
args: ${{ env.RELEASE_ARGS }}
workdir: cli
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ef3e2a5

Please sign in to comment.