mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 20:25:07 +08:00
c4b61562b6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
89 lines
2.7 KiB
YAML
89 lines
2.7 KiB
YAML
name: Build Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- refactor-structure
|
|
tags:
|
|
- '**'
|
|
|
|
env:
|
|
packageName: "nadena.dev.modular-avatar"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Checkout logo assets
|
|
uses: actions/checkout@v4
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
repository: bdunderscore/modular-avatar-images
|
|
path: .github/image-assets
|
|
- name: Inject logo assets
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
run: |
|
|
cp -f .github/image-assets/img/logo/ma_logo.png Editor/Images/logo.png
|
|
cp -f .github/image-assets/img/logo/ma_icon.png Runtime/Icons/Icon_MA_Script.png
|
|
|
|
- name: Check semver syntax
|
|
id: semver-check
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
REF_NAME: ${{ github.ref }}
|
|
run: |
|
|
if echo $REF_NAME | grep '[a-z]-[0-9]' && ! echo $REF_NAME | grep '^refs/tags/1\.5\.0-'; then
|
|
echo "Tag name does not follow semver prerelease syntax: $REF_NAME"
|
|
exit 1
|
|
fi
|
|
|
|
- name: get version
|
|
id: version
|
|
uses: notiz-dev/github-action-json-property@a5a9c668b16513c737c3e1f8956772c99c73f6e8
|
|
with:
|
|
path: "package.json"
|
|
prop_path: "version"
|
|
|
|
- name: Check tag consistency
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
run: |
|
|
if [ "${{ steps.version.outputs.prop }}" != "${GITHUB_REF##*/}" ]; then
|
|
echo "Version in package.json does not match tag name: ${{ steps.version.outputs.prop }} != ${GITHUB_REF##*/}"
|
|
exit 1
|
|
fi
|
|
|
|
- run: echo ${{steps.version.outputs.prop}}
|
|
|
|
- name: Set Environment Variables
|
|
run: |
|
|
echo "zipFile=${{ env.packageName }}-${{ steps.version.outputs.prop }}".zip >> $GITHUB_ENV
|
|
echo "unityPackage=${{ env.packageName }}-${{ steps.version.outputs.prop }}.unitypackage" >> $GITHUB_ENV
|
|
|
|
- name: Create Zip
|
|
run: |
|
|
zip ".github/${{env.zipFile}}" ./* -r -x .github .git '.git/*' '*~/*' '*.ps1*'
|
|
mv ".github/${{env.zipFile}}" "${{env.zipFile}}"
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: package-zip
|
|
path: ${{ env.zipFile }}
|
|
|
|
- name: Make Release
|
|
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
draft: true
|
|
generate_release_notes: true
|
|
tag_name: ${{ steps.version.outputs.prop }}
|
|
files: |
|
|
${{ env.zipFile }}
|
|
package.json
|