Skip to content

Commit

Permalink
ci: added the version detection for prerelease in release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kurone-kito committed Jul 18, 2024
1 parent 8bcf15a commit e7f245e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
contents: write
env:
packagePath: Packages/${{ vars.PACKAGE_NAME }}
stableVersion:
unityPackage:
version:
zipFile:
Expand All @@ -39,8 +40,17 @@ jobs:
uses: sergeysova/jq-action@v2
with:
cmd: jq -r ".version" "${{ env.packagePath }}/package.json"
- name: Detect whether the version is a stable release
id: stable-match
# cspell: disable-next-line
uses: kaisugi/action-regex-match@v1.0.1
with:
flags: gm
regex: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
text: ${{ steps.version.outputs.value }}
- name: Configure the Environment Variables needed for releasing the Package
run: |
echo "stableVersion=${{ steps.stable-match.outputs.match }}" >> $GITHUB_ENV
echo "unityPackage=${{ vars.PACKAGE_NAME }}-${{ steps.version.outputs.value }}.unitypackage" >> $GITHUB_ENV
echo "version=${{ steps.version.outputs.value }}" >> $GITHUB_ENV
echo "zipFile=${{ vars.PACKAGE_NAME }}-${{ steps.version.outputs.value }}".zip >> $GITHUB_ENV
Expand Down Expand Up @@ -70,4 +80,5 @@ jobs:
${{ env.unityPackage }}
${{ env.unityPackage }}.zip
${{ env.packagePath }}/package.json
prerelease: ${{ env.stableVersion == '' }}
tag_name: ${{ env.version }}

0 comments on commit e7f245e

Please sign in to comment.