diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cda3c39..09c4d5c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,14 @@ name: Release on: push + +env: + packageName: "com.nekometer.esnya.inari-udon" + +permissions: + contents: write + jobs: - release: + semantic-release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -9,6 +16,58 @@ jobs: with: node-version: lts/* - run: npm i -g semantic-release semantic-release-gitmoji @semantic-release/github @semantic-release/git @semantic-release/npm foreach-cli + + - id: prev_version + uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31 + with: + path: "Packages/${{env.packageName}}/package.json" + prop_path: "version" + - run: npx semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - id: version + uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31 + with: + path: "Packages/${{env.packageName}}/package.json" + prop_path: "version" + outputs: + prev_version: ${{ steps.prev_version.outputs.prop }} + next_version: ${{ steps.version.outputs.prop }} + + vcc-release: + runs-on: ubuntu-latest + needs: semantic-release + if: needs.semantic-release.outputs.prev_version != needs.semantic-release.outputs.next_version + steps: + - uses: actions/checkout@v3 + - run: echo "version=${{ needs.semantic-release.outputs.next_version }}" >> $GITHUB_ENV + + - run: | + echo "zipFile=${{ env.packageName }}-${{ env.version }}".zip >> $GITHUB_ENV + echo "unityPackage=${{ env.packageName }}-${{ env.version }}.unitypackage" >> $GITHUB_ENV + - uses: thedoctor0/zip-release@09336613be18a8208dfa66bd57efafd9e2685657 + with: + type: "zip" + directory: "Packages/${{env.packageName}}/" + filename: "../../${{env.zipFile}}" # make the zip file two directories up, since we start two directories in above + + - run: find "Packages/${{env.packageName}}/" -name \*.meta >> metaList + - uses: pCYSl5EDgo/create-unitypackage@cfcd3cf0391a5ef1306342794866a9897c32af0b + with: + package-path: ${{ env.unityPackage }} + include-files: metaList + + - uses: svenstaro/upload-release-action@v2 + with: + tag: v${{ env.version }} + file: ${{ env.zipFile }} + - uses: svenstaro/upload-release-action@v2 + with: + tag: v${{ env.version }} + file: ${{ env.unityPackage }} + - uses: svenstaro/upload-release-action@v2 + with: + tag: v${{ env.version }} + file: Packages/${{ env.packageName }}/package.json diff --git a/.github/workflows/vcc-release.yml b/.github/workflows/vcc-release.yml deleted file mode 100644 index 7558691..0000000 --- a/.github/workflows/vcc-release.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Build Release - -on: - workflow_dispatch: - push: - tags: - - v* - -env: - packageName: "com.nekometer.esnya.inari-udon" - -permissions: - contents: write - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: get version - id: version - uses: notiz-dev/github-action-json-property@7c8cf5cc36eb85d8d287a8086a39dac59628eb31 - with: - path: "Packages/${{env.packageName}}/package.json" - prop_path: "version" - - - 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 - uses: thedoctor0/zip-release@09336613be18a8208dfa66bd57efafd9e2685657 - with: - type: "zip" - directory: "Packages/${{env.packageName}}/" - filename: "../../${{env.zipFile}}" # make the zip file two directories up, since we start two directories in above - - - run: find "Packages/${{env.packageName}}/" -name \*.meta >> metaList - - - name: Create UnityPackage - uses: pCYSl5EDgo/create-unitypackage@cfcd3cf0391a5ef1306342794866a9897c32af0b - with: - package-path: ${{ env.unityPackage }} - include-files: metaList - - - - name: Make Release - uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 - with: - tag_name: ${{ steps.version.outputs.prop }} - files: | - ${{ env.zipFile }} - ${{ env.unityPackage }} - Packages/${{ env.packageName }}/package.json diff --git a/Packages/com.nekometer.esnya.inari-udon/package.json b/Packages/com.nekometer.esnya.inari-udon/package.json index bb0b0bd..9d56ac2 100644 --- a/Packages/com.nekometer.esnya.inari-udon/package.json +++ b/Packages/com.nekometer.esnya.inari-udon/package.json @@ -1,7 +1,7 @@ { "name": "com.nekometer.esnya.inari-udon", "displayName": "InariUdon", - "version": "10.0.0-beta.1", + "version": "10.0.0-alpha.3", "private": true, "description": " Useful prefabs and Udon scripts for VRChat World SDK 3.0", "keywords": [ diff --git a/package.json b/package.json index a88b2fc..53fe700 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inariudon", - "version": "10.0.0-alpha.1", + "version": "10.0.0-alpha.3", "workspaces": [ "Packages/*" ],