From 88dd3cffdb619b50aa3d2b27286a1e21adf2ec79 Mon Sep 17 00:00:00 2001 From: bd_ Date: Thu, 8 Sep 2022 20:37:40 -0700 Subject: [PATCH] Fixing/updating workflows --- .github/workflows/build-pages.yml | 50 ++++++++--------------------- .github/workflows/build-release.yml | 18 +++++++++-- 2 files changed, 28 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-pages.yml b/.github/workflows/build-pages.yml index b9507918..57f58b7a 100644 --- a/.github/workflows/build-pages.yml +++ b/.github/workflows/build-pages.yml @@ -2,13 +2,18 @@ name: Build documentation on: push: branches: - - test + - main + workflow_dispatch: -env: - listPublishDirectory: docs/build - vpmSubDirectory: vpm - pathToCi: ci +permissions: + contents: read + pages: write + id-token: write +concurrency: + group: "pages" + cancel-in-progress: true + jobs: build-listing: name: build-listing @@ -21,30 +26,12 @@ jobs: with: node-version: 18 - uses: actions/checkout@v3 # check out this repo - - uses: actions/checkout@v3 # check out automation repo - with: - repository: vrchat-community/package-list-action - path: ${{env.pathToCi}} - clean: false # otherwise the local repo will no longer be checked out - name: Build docs run: | cd docs npm install - npm build - - - name: Restore Cache - uses: actions/cache@v2 - with: - path: | - ${{env.pathToCi}}/.nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - - - name: Build Package Version Listing - run: ${{env.pathToCi}}/build.cmd BuildRepoListing --root ${{env.pathToCi}} --list-publish-directory $GITHUB_WORKSPACE/${{env.listPublishDirectory}}/${{env.vpmSubDirectory}} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + npm run build - name: Setup Pages uses: actions/configure-pages@v2 @@ -52,19 +39,8 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: ${{env.listPublishDirectory}} + path: docs/build - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 - build_docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Docusaurus BuildDeploy Action - uses: redkubes/docusaurus-deploy-action@v1.2 - with: - source-folder: docs - git-user: docusaurus - git-password: ${{ secrets.GITHUB_TOKEN }} - deployment-branch: gh-pages \ No newline at end of file + uses: actions/deploy-pages@v1 \ No newline at end of file diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 9df8f6cd..321cf175 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -3,8 +3,10 @@ name: Build Release on: workflow_dispatch: push: - branches: main - paths: Packages/net.fushizen.modular-avatar/** + branches: + - main + tags: + - '**' env: packageName: "net.fushizen.modular-avatar" @@ -23,6 +25,14 @@ jobs: with: path: "Packages/${{env.packageName}}/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}} @@ -46,10 +56,12 @@ jobs: package-path: ${{ env.unityPackage }} include-files: metaList - - name: Make Release uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 + if: startsWith(github.ref, 'refs/tags/') with: + draft: true + generate_release_notes: true tag_name: ${{ steps.version.outputs.prop }} files: | ${{ env.zipFile }}