Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/base-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,24 @@ env:
GORELEASER_PRO_VERSION: v2.11.2

jobs:
prepare:
prev-tag:
outputs:
PREVIOUS_RELEASE_TAG: ${{ steps.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
fetch-depth: 0
- name: Set goreleaser last tag reference in case of non-nightly release
id: prev-tag
if: inputs.nightly != 'true'
# find previous tag by filtering out nightly tags and binary release (OCB, OpAMP) tags and then choosing the
# second to last tag (last one is the current release)
run: |
prev_tag=$(git tag | grep -v "cmd" | grep -v "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
echo "PREVIOUS_RELEASE_TAG=$prev_tag" >> "$GITHUB_OUTPUT"

prepare:
strategy:
matrix:
GOOS: ${{ fromJSON(inputs.goos) }}
Expand Down Expand Up @@ -80,15 +95,6 @@ jobs:
go-version: "~1.24"
check-latest: true

- name: Set goreleaser last tag reference in case of non-nightly release
id: prev-tag
if: inputs.nightly != 'true'
# find previous tag by filtering out nightly tags and binary release (OCB, OpAMP) tags and then choosing the
# second to last tag (last one is the current release)
run: |
prev_tag=$(git tag | grep -v "cmd" | grep -v "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
echo "PREVIOUS_RELEASE_TAG=$prev_tag" >> "$GITHUB_OUTPUT"

- name: Set nightly enabled
id: nightly-check
if: inputs.nightly == 'true'
Expand Down Expand Up @@ -258,7 +264,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_YES: true
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GORELEASER_PREVIOUS_TAG: ${{ needs.prepare.outputs.PREVIOUS_RELEASE_TAG }}
GORELEASER_PREVIOUS_TAG: ${{ needs.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}

create-issue:
Expand Down
Loading