From eb63e8be92054386a88beda570f68402601dbf73 Mon Sep 17 00:00:00 2001 From: scott45 Date: Mon, 2 Dec 2024 10:51:40 +0300 Subject: [PATCH] feat: publish to remove rc tag before release --- .github/workflows/publish.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 926349c..b62fa6c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,7 @@ jobs: build-and-publish: runs-on: ubuntu-latest env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN_LIB }} permissions: packages: write contents: read @@ -34,7 +34,7 @@ jobs: - name: Set up NPM authentication run: | - echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" > ~/.npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN_LIB }}" > ~/.npmrc cat .npmrc - name: Configure Git @@ -65,13 +65,10 @@ jobs: run: npm run build - name: Publish package - run: | - git config user.email ${{ secrets.GH_EMAIL }} - git config user.name ${{ secrets.GH_USERNAME }} - npm publish + run: npm publish env: - GITHUB_TOKEN: '${{ secrets.GH_TOKEN_LIB }}' - NODE_AUTH_TOKEN: '${{ secrets.GH_TOKEN_LIB }}' + GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + NODE_AUTH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - name: Capture Version id: capture_version @@ -82,16 +79,16 @@ jobs: - name: Push Changes in package.json and make PRs run: | export GH_USERNAME=${{ secrets.GH_USERNAME }} - export GH_TOKEN=${{ secrets.GH_TOKEN }} + export GH_TOKEN=${{ secrets.GH_TOKEN_LIB }} git config --global user.name ${{ secrets.GH_USERNAME }} # Clear the GITHUB_TOKEN environment variable and use a temporary file for gh authentication - echo "${{ secrets.GH_TOKEN }}" > /tmp/gh_token + echo "${{ secrets.GH_TOKEN_LIB }}" > /tmp/gh_token unset GITHUB_TOKEN unset GH_TOKEN gh auth login --with-token < /tmp/gh_token - git clone https://${{ secrets.GH_USERNAME }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git + git clone https://${{ secrets.GH_USERNAME }}:${{ secrets.GH_TOKEN_LIB }}@github.com/${{ github.repository }}.git REPO_NAME=$(basename -s .git https://github.com/${{ github.repository }}.git) cd $REPO_NAME echo "Currently in repository directory: $(pwd)"