diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index be6f1650..17c2fbb1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,18 +27,18 @@ on: version: description: 'Version (v4.0.0.0)' type: string - required: false jobs: main: name: Build & Bundle environment: name: ${{inputs.environment}} - url: ${{ steps.artifact-upload-step.outputs.artifact-url }} + url: ${{ steps.release.outputs.url || steps.artifact-upload-step.outputs.artifact-url}} runs-on: ubuntu-latest permissions: - contents: read + contents: write actions: read + discussions: write steps: - uses: actions/checkout@v4 with: @@ -82,13 +82,25 @@ jobs: - name: Bundle Projects run: | mkdir bundle - cd dist/apps - zip -r ../../bundle/acf-i18n.zip acf-i18n/ + cd dist/apps/acf-i18n + zip -r ../../../bundle/acf-i18n-${{vars.NX_PUBLIC_VARIANT}}.zip . + cd .. cd acf-options-page - zip -r ../../../bundle/acf-options-page.zip . + zip -r ../../../bundle/acf-options-page-${{vars.NX_PUBLIC_VARIANT}}.zip . cd .. cd acf-extension - zip -r ../../../bundle/acf-extension.zip . + zip -r ../../../bundle/acf-extension-${{vars.NX_PUBLIC_VARIANT}}.zip . + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + id: release + with: + token: ${{ secrets.REPO_PAT }} # Use the PAT here + prerelease: ${{ vars.NX_VARIANT == 'BETA' || vars.NX_VARIANT == 'DEV'}} + repository: Dhruv-Techapps/acf-docs + generate_release_notes: true + discussion_category_name: 'Release' + fail_on_unmatched_files: true - uses: actions/upload-artifact@v4 id: artifact-upload-step with: @@ -111,7 +123,7 @@ jobs: uses: mnao305/chrome-extension-upload@v5.0.0 id: chrome-extension-upload with: - file-path: acf-extension.zip + file-path: acf-extension-${{vars.NX_PUBLIC_VARIANT}}.zip extension-id: ${{ vars.NX_PUBLIC_CHROME_EXTENSION_ID }} client-id: ${{ secrets.CLIENT_ID }} client-secret: ${{ secrets.CLIENT_SECRET }} @@ -135,7 +147,7 @@ jobs: with: name: nx-main-artifacts - name: unzip - run: unzip acf-options-page.zip -d acf-options-page + run: unzip acf-options-page-${{vars.NX_PUBLIC_VARIANT}}.zip -d acf-options-page - name: Build And Deploy id: deploy uses: Azure/static-web-apps-deploy@v1