Skip to content

Commit df2e064

Browse files
authored
feat: consider pre-releases in build pipeline (#862)
This PR adds logic to the build pipeline to differentiate between stable releases and pre-releases, ensuring that GitHub release creation and issue commenting only occur for stable releases (matching the pattern `v[0-9]+.[0-9]+.[0-9]+$` without additional suffixes). ### Key Changes: - Added pre-release detection steps that check if tags match the stable release pattern - Conditionally execute GitHub release creation only for stable releases - Conditionally execute issue/PR commenting only for stable releases
1 parent 36a9473 commit df2e064

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,14 @@ jobs:
190190
do
191191
dotnet nuget push $entry --source https://api.nuget.org/v3/index.json --api-key "${{secrets.NUGET_API_KEY}}" --skip-duplicate
192192
done
193+
- name: Check pre-release
194+
id: check-pre-release
195+
run: |
196+
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
197+
echo "release=true" >> $GITHUB_OUTPUT
198+
fi
193199
- name: Create GitHub release
200+
if: steps.check-pre-release.outputs.release == 'true'
194201
continue-on-error: true
195202
uses: softprops/action-gh-release@v2
196203
with:
@@ -209,7 +216,14 @@ jobs:
209216
issues: write
210217
pull-requests: write
211218
steps:
219+
- name: Check pre-release
220+
id: check-pre-release
221+
run: |
222+
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
223+
echo "release=true" >> $GITHUB_OUTPUT
224+
fi
212225
- name: Comment relevant issues and pull requests
226+
if: steps.check-pre-release.outputs.release == 'true'
213227
continue-on-error: true
214228
uses: apexskier/[email protected]
215229
with:

0 commit comments

Comments
 (0)