Skip to content

Commit

Permalink
other token
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasengels committed Oct 10, 2024
1 parent 0f7076d commit 2a62777
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions .github/workflows/build-release-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,36 +33,10 @@ jobs:
run: npm run build

# Job 2: Publish the library to npm on push to main
publish:
needs: test-and-build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Build the library
run: npm run build --prod

- name: Create .npmrc
run: echo "@govflanders:registry=https://registry.npmjs.org//registry.npmjs.org/:_authToke=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish to npm
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

create-pr:
runs-on: ubuntu-latest
needs: publish # Ensure this job runs after publishing
needs: test-and-build # Ensure this job runs after publishing
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -91,3 +65,32 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
target_branch: 'main'


publish:
if: github.event_name == 'push' && github.ref =='refs/heads/main' && github.repository_owner == 'govflanders' # Triggered
needs: auto-merge
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Build the library
run: npm run build --prod

- name: Create .npmrc
run: echo "@govflanders:registry=https://registry.npmjs.org//registry.npmjs.org/:_authToke=${{ secrets.NPMJS_TOKEN }}" > ~/.npmrc

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}

0 comments on commit 2a62777

Please sign in to comment.