Skip to content

Commit

Permalink
Add use of NODE_AUTH_TOKEN when releasing (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcalthrop authored Dec 10, 2024
1 parent 41a3547 commit ab1ae81
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/actions/get-node-version/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Get node version'
description: 'Read node version defined in package.json'
name: Get node version
description: Read node version defined in package.json

outputs:
value:
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name: Prepare
description: Installs dependencies

runs:
using: composite
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR validation

on:
pull_request:
types: [ready_for_review, opened, synchronize, reopened, push]
types: [ready_for_review, opened, synchronize, reopened, edited]
branches:
- main

Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
build:
name: Build and publish
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/[email protected]

Expand All @@ -18,16 +21,22 @@ jobs:
run: pnpm nx build nx-playwright

- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
run: |
set -x
cd dist/packages/nx-playwright
echo "scope=@mands" > .npmrc
echo "@mands:registry=https://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
{
echo "scope=@mands"
echo "@mands:registry=https://registry.npmjs.org/"
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
} > .npmrc
pnpm publish --access=public
VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')
VERSION=$(node --print "require('./package.json').version")
echo "Tagging version $VERSION"
git config user.name release-bot
git config user.email [email protected]
git tag -a $VERSION -m "Version ${VERSION}"
git push origin $VERSION
git tag -a "${VERSION}" -m "Version ${VERSION}"
git push origin "${VERSION}"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mands/nx-plugins",
"version": "0.7.0-beta-3",
"version": "0.7.0-beta-4",
"description": "Nx plugins by M&S engineering",
"license": "MIT",
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/nx-playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mands/nx-playwright",
"version": "0.7.0-beta-3",
"version": "0.7.0-beta-4",
"license": "MIT",
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down

0 comments on commit ab1ae81

Please sign in to comment.