Skip to content

Commit faf56ac

Browse files
committed
release: v0.0.2
1 parent 4bccc38 commit faf56ac

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
runs-on: ubuntu-latest
2222
permissions:
2323
contents: write
24+
outputs:
25+
release_match: ${{ steps.detect.outputs.match }}
26+
release_version: ${{ steps.detect.outputs.version }}
2427
steps:
2528
- uses: actions/checkout@v4
2629
with:
@@ -71,7 +74,8 @@ jobs:
7174
echo "Tag v$ver pushed. A new workflow run should start for that tag to build & release."
7275
7376
build-matrix:
74-
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
77+
needs: tag-on-message
78+
if: needs.tag-on-message.outputs.release_match == 'true' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
7579
name: build (${{ matrix.os }} ${{ matrix.goos }}-${{ matrix.goarch }})
7680
runs-on: ${{ matrix.os }}
7781
strategy:
@@ -144,21 +148,23 @@ jobs:
144148
if-no-files-found: error
145149

146150
release:
147-
needs: build-matrix
148-
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
151+
needs: [tag-on-message, build-matrix]
152+
if: needs.tag-on-message.outputs.release_match == 'true' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
149153
runs-on: ubuntu-latest
150154
permissions:
151155
contents: write
152156
steps:
153157
- uses: actions/checkout@v4
154158
with:
155159
fetch-depth: 0
156-
157-
- name: Determine version
160+
- name: Set release version
158161
id: ver
159162
run: |
163+
set -euo pipefail
160164
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
161165
ver="${GITHUB_REF#refs/tags/v}"
166+
elif [[ "${{ needs.tag-on-message.outputs.release_match }}" == "true" ]]; then
167+
ver="${{ needs.tag-on-message.outputs.release_version }}"
162168
elif [[ -n "${{ github.event.inputs.version }}" ]]; then
163169
ver="${{ github.event.inputs.version }}"
164170
else

0 commit comments

Comments
 (0)