diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa7fa1fc..e501e35a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,14 +82,12 @@ 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: @@ -97,6 +95,7 @@ jobs: - 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" @@ -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: @@ -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: @@ -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: