From 5c923b8dc21976357d15fe8f2c73420893add7a6 Mon Sep 17 00:00:00 2001 From: BellCube Dev <33764825+BellCubeDev@users.noreply.github.com> Date: Thu, 31 Aug 2023 20:16:54 -0400 Subject: [PATCH] Proper Package Tagging --- .github/workflows/publish.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index bf278cf..0c413ed 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,6 +5,7 @@ on: jobs: test: + name: Test Before Release uses: ./.github/workflows/test.yaml build: needs: test @@ -12,6 +13,9 @@ jobs: runs-on: ubuntu-latest permissions: packages: write + + env: + TAG: ${{ github.event.release.prerelease == true && 'pre-release' }} ${{ github.event.release.prerelease == false || startsWith(github.event.release.tag_name, '0.') && 'latest' }} steps: - name: Checkout uses: actions/checkout@v3 @@ -34,17 +38,21 @@ jobs: token: ${{ secrets.NPM_ACCESS_TOKEN }} registry: https://registry.npmjs.org/ check-version: true + tag: ${{ env.TAG }} + - uses: jossef/action-set-json-field@v2 name: "Change Package Name for GitHub" with: file: package.json field: name value: "@${{ github.repository_owner }}/${{ github.event.repository.name }}" + - uses: JS-DevTools/npm-publish@v1 name: "Publish to GitHub Packages Registry" with: token: ${{ secrets.GITHUB_TOKEN }} registry: https://npm.pkg.github.com check-version: true + tag: ${{ env.TAG }}