Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add use of NODE_AUTH_TOKEN when releasing #119

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading