File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 4040 GORELEASER_PRO_VERSION : v2.12.5
4141
4242jobs :
43+ prev-tag :
44+ outputs :
45+ PREVIOUS_RELEASE_TAG : ${{ steps.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
46+ runs-on : ubuntu-latest
47+ steps :
48+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
49+ with :
50+ fetch-depth : 0
51+ - name : Set goreleaser last tag reference in case of non-nightly release
52+ id : prev-tag
53+ if : inputs.nightly != 'true'
54+ # find previous tag by filtering out nightly tags and binary release (OCB, OpAMP) tags and then choosing the
55+ # second to last tag (last one is the current release)
56+ run : |
57+ prev_tag=$(git tag | grep -v "cmd" | grep -v "nightly" | sort -r --version-sort | head -n 2 | tail -n 1)
58+ echo "PREVIOUS_RELEASE_TAG=$prev_tag" >> "$GITHUB_OUTPUT"
59+
4360 check-goreleaser :
4461 strategy :
4562 matrix :
6784 - GOOS : windows
6885 GOARCH : riscv64
6986 runs-on : ${{ inputs.runner_os }}
87+ needs : prev-tag
7088 outputs :
7189 version : ${{ steps.prep.outputs.version }}
7290
@@ -161,6 +179,7 @@ jobs:
161179 GOAMD64 : v1
162180 GOPPC64 : power8
163181 GORELEASER_KEY : ${{ secrets.GORELEASER_KEY }}
182+ GORELEASER_PREVIOUS_TAG : ${{ needs.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
164183
165184 - name : Move built artifacts
166185 if : inputs.distribution == 'otelcol-contrib' && inputs.nightly != true
@@ -184,6 +203,7 @@ jobs:
184203 GOAMD64 : v1
185204 GOPPC64 : power8
186205 GORELEASER_KEY : ${{ secrets.GORELEASER_KEY }}
206+ GORELEASER_PREVIOUS_TAG : ${{ needs.prev-tag.outputs.PREVIOUS_RELEASE_TAG }}
187207
188208 - name : Print built artifacts
189209 run : cat ./distributions/${{ inputs.distribution }}/dist/**/artifacts.json
You can’t perform that action at this time.
0 commit comments