Skip to content

Commit

Permalink
feat: publish to remove rc tag before release
Browse files Browse the repository at this point in the history
  • Loading branch information
scott45 committed Dec 2, 2024
1 parent ce8c8f8 commit eb63e8b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)"
Expand Down

0 comments on commit eb63e8b

Please sign in to comment.