mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-11 23:19:00 +08:00
ci: fixing issues with releaser workflow
This commit is contained in:
parent
1c8477ba4a
commit
5de63b3495
41
.github/workflows/perform-release.yml
vendored
41
.github/workflows/perform-release.yml
vendored
@ -46,7 +46,7 @@ jobs:
|
|||||||
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
|
uses: bdunderscore/modular-avatar/.github/workflows/build-test-docs.yml@main
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
needs: [check-gameci, check-docs]
|
needs: [ check-gameci, check-docs ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -55,22 +55,29 @@ jobs:
|
|||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
run: echo "$GITHUB_CONTEXT"
|
run: echo "$GITHUB_CONTEXT"
|
||||||
|
|
||||||
|
# https://github.com/orgs/community/discussions/13836#discussioncomment-8535364
|
||||||
|
- uses: actions/create-github-app-token@v1
|
||||||
|
id: app-token
|
||||||
|
with:
|
||||||
|
app-id: ${{ vars.RELEASER_APP_ID }}
|
||||||
|
private-key: ${{ secrets.RELEASER_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: Validate prerelease version
|
- name: Validate prerelease version
|
||||||
id: check-version
|
id: check-version
|
||||||
if: ${{ github.event.inputs.release_kind == 'prerelease' && !contains(github.event.inputs.version, '-') }}
|
if: ${{ github.event.inputs.release_kind == 'prerelease' && !contains(github.event.inputs.version, '-') }}
|
||||||
run:
|
run:
|
||||||
echo "Prerelease version must contain a hyphen"
|
echo "Prerelease version must contain a hyphen"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Validate stable version
|
- name: Validate stable version
|
||||||
id: check-version-stable
|
id: check-version-stable
|
||||||
if: ${{ github.event.inputs.release_kind == 'stable' && contains(github.event.inputs.version, '-') }}
|
if: ${{ github.event.inputs.release_kind == 'stable' && contains(github.event.inputs.version, '-') }}
|
||||||
run:
|
run:
|
||||||
echo "Stable version must not contain a hyphen"
|
echo "Stable version must not contain a hyphen"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Validate adhoc
|
- name: Validate adhoc
|
||||||
id: validate-adhocc
|
id: validate-adhoc
|
||||||
if: ${{ github.event.inputs.release_kind == 'adhoc' && github.event.inputs.publish == 'true' }}
|
if: ${{ github.event.inputs.release_kind == 'adhoc' && github.event.inputs.publish == 'true' }}
|
||||||
run:
|
run:
|
||||||
echo "Adhoc release cannot be published"
|
echo "Adhoc release cannot be published"
|
||||||
@ -80,9 +87,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "zipFile=${{ env.PKG_NAME }}-${{ github.event.inputs.version }}".zip >> $GITHUB_ENV
|
echo "zipFile=${{ env.PKG_NAME }}-${{ github.event.inputs.version }}".zip >> $GITHUB_ENV
|
||||||
echo "unityPackage=${{ env.PKG_NAME }}-${{ github.event.inputs.version }}.unitypackage" >> $GITHUB_ENV
|
echo "unityPackage=${{ env.PKG_NAME }}-${{ github.event.inputs.version }}.unitypackage" >> $GITHUB_ENV
|
||||||
|
|
||||||
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
case "$RELEASE_TYPE" in
|
case "$RELEASE_TYPE" in
|
||||||
prerelease)
|
prerelease)
|
||||||
echo "PRERELEASE=true" >> $GITHUB_ENV
|
echo "PRERELEASE=true" >> $GITHUB_ENV
|
||||||
@ -99,14 +106,15 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
- name: Check semver syntax
|
- name: Check semver syntax
|
||||||
if: steps.check-tag.outputs.need-new-tag == 'true'
|
if: steps.check-tag.outputs.need-new-tag == 'true'
|
||||||
id: semver-check
|
id: semver-check
|
||||||
run: |
|
run: |
|
||||||
chmod +x .github/workflows/*.sh
|
chmod +x .github/workflows/*.sh
|
||||||
.github/workflows/check-semver-syntax.sh ${{ github.event.inputs.version }}
|
.github/workflows/check-semver-syntax.sh ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
- name: Set git user and email
|
- name: Set git user and email
|
||||||
id: git-config
|
id: git-config
|
||||||
run: |
|
run: |
|
||||||
@ -119,22 +127,20 @@ jobs:
|
|||||||
mv package.json.tmp package.json
|
mv package.json.tmp package.json
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ github.event.inputs.version }}
|
VERSION: ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
|
|
||||||
- name: Update changelog
|
- name: Update changelog
|
||||||
id: changelog
|
id: changelog
|
||||||
run: |
|
run: |
|
||||||
chmod +x .github/*.pl
|
chmod +x .github/*.pl
|
||||||
|
|
||||||
if [ "${{ env.PRERELEASE }}" == "true" ]; then
|
if [ "${{ env.PRERELEASE }}" == "true" ]; then
|
||||||
./.github/cut-changelog.pl CHANGELOG-PRERELEASE.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }} .github/relnote-en.md
|
./.github/cut-changelog.pl CHANGELOG-PRERELEASE.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }} .github/relnote-en.md
|
||||||
./.github/cut-changelog.pl CHANGELOG-PRERELEASE-jp.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }} .github/relnote-jp.md
|
|
||||||
else
|
else
|
||||||
./.github/cut-changelog.pl CHANGELOG-PRERELEASE.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }}
|
./.github/cut-changelog.pl CHANGELOG-PRERELEASE.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }}
|
||||||
./.github/cut-changelog.pl CHANGELOG-PRERELEASE-jp.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }}
|
|
||||||
./.github/cut-changelog.pl CHANGELOG.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }} .github/relnote-en.md
|
./.github/cut-changelog.pl CHANGELOG.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }} .github/relnote-en.md
|
||||||
./.github/cut-changelog.pl CHANGELOG-jp.md .github/CHANGELOG-HEADER.md ${{ env.VERSION }} .github/relnote-jp.md
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo Version ${{ env.VERSION }} > release-note.md
|
echo Version ${{ env.VERSION }} > release-note.md
|
||||||
echo >> release-note.md
|
echo >> release-note.md
|
||||||
if [ "${{ env.PRERELEASE }}" == "true" ]; then
|
if [ "${{ env.PRERELEASE }}" == "true" ]; then
|
||||||
@ -144,8 +150,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo '## Notable changes' >> release-note.md
|
echo '## Notable changes' >> release-note.md
|
||||||
cat .github/relnote-en.md >> release-note.md
|
cat .github/relnote-en.md >> release-note.md
|
||||||
echo '## 主な変更点' >> release-note.md
|
|
||||||
cat .github/relnote-jp.md >> release-note.md
|
|
||||||
|
|
||||||
- name: Upload CHANGELOG.md
|
- name: Upload CHANGELOG.md
|
||||||
if: ${{ github.event.inputs.release_kind == 'stable' }}
|
if: ${{ github.event.inputs.release_kind == 'stable' }}
|
||||||
@ -173,7 +177,10 @@ jobs:
|
|||||||
- name: Publish tag
|
- name: Publish tag
|
||||||
if: ${{ github.event.inputs.publish == 'true' }}
|
if: ${{ github.event.inputs.publish == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
git push origin ${{ github.event.workflow_dispatch.base.ref }} ${{ github.event.inputs.version }}
|
BRANCH_NAME=$(git branch --show-current)
|
||||||
|
git push origin $BRANCH_NAME && git push origin ${{ github.event.inputs.version }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
|
||||||
- name: Create Zip
|
- name: Create Zip
|
||||||
run: |
|
run: |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user