Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
parens around if statement to only run releases on master. git fetch --tags before requesting next tag
  • Loading branch information
amarcum committed May 27, 2024
1 parent 8141621 commit 21a3f2f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,20 @@ jobs:

# Increments to the next tag on master only, bumps version based on the recent commits
new_tag:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' && github.event_name == 'push'
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && github.event_name == 'push'
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get next version
id: new_git_tag
run: |
git fetch --tags
go install github.com/caarlos0/svu@latest
NEW_TAG=$(svu next --force-patch-increment)
echo "Using the next tag of ${NEW_TAG} for this release"
Expand All @@ -107,7 +106,7 @@ jobs:

# Creates a new release page on GitHub when master changes
create_release:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' && github.event_name == 'push'
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && github.event_name == 'push'
runs-on: ubuntu-latest
needs: new_tag
steps:
Expand All @@ -129,7 +128,7 @@ jobs:
# In this Release section, we are re-building the binaries because eventually we can include the new git tag as their
# version string when saying 'colly --version'
build_and_upload:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' && github.event_name == 'push'
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && github.event_name == 'push'
runs-on: ubuntu-latest
needs: [test, new_tag, create_release]
strategy:
Expand Down Expand Up @@ -164,8 +163,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand Down

0 comments on commit 21a3f2f

Please sign in to comment.