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 689ef64 commit 17d0052
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 11 additions & 6 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 @@ -32,14 +32,19 @@ jobs:
# Defaults to the user or organization that owns the workflow file
scope: '@frmscoe'

- name: Set up NPM authentication
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN_LIB }}" > ~/.npmrc
cat .npmrc
- name: Configure Git
run: |
git config user.email ${{ secrets.GH_EMAIL }}
git config user.name ${{ secrets.GH_USERNAME }}
- name: Version bumping
env:
GH_TOKEN: '${{ secrets.GH_TOKEN }}'
GITHUB_TOKEN: '${{ secrets.GH_TOKEN_LIB }}'
run: |
commit_message=$(git log -1 --pretty=%B)
echo "Commit message: $commit_message"
Expand All @@ -54,7 +59,7 @@ jobs:
- name: Install dependencies
run: npm ci
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Build library
run: npm run build
Expand All @@ -74,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
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

@tazama-lf:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GH_TOKEN}

0 comments on commit 17d0052

Please sign in to comment.