Skip to content

Commit c4a2773

Browse files
authored
Update release process for NPM changes (#62)
1 parent bb1d7ff commit c4a2773

File tree

4 files changed

+12
-52
lines changed

4 files changed

+12
-52
lines changed

.github/workflows/release_canary.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ on:
1010
node_version:
1111
type: number
1212
required: false
13-
default: 20
14-
use_gpr:
15-
type: boolean
16-
required: false
17-
default: false
13+
default: 24
1814
secrets:
1915
gh_token:
2016
required: true
21-
npm_token:
22-
required: true
2317

2418
jobs:
2519
release-canary:
@@ -35,34 +29,20 @@ jobs:
3529
- name: Set up Node
3630
uses: actions/setup-node@v6
3731
with:
38-
node_version: ${{ inputs.node_version }}
32+
node-version: ${{ inputs.node_version }}
3933

4034
- name: Install dependencies
4135
run: ${{ inputs.install }}
4236

4337
- name: Build
4438
run: npm run build --if-present
4539

46-
- name: Create .npmrc
47-
run: |
48-
if [ "$use_gpr" = "true" ]; then
49-
registry="//npm.pkg.github.com/"
50-
else
51-
registry="//registry.npmjs.org/"
52-
fi
53-
cat << EOF > "$HOME/.npmrc"
54-
$registry:_authToken=$NPM_TOKEN
55-
EOF
56-
env:
57-
use_gpr: ${{ inputs.use_gpr }}
58-
NPM_TOKEN: ${{ secrets.npm_token }}
59-
6040
- name: Publish canary release
6141
run: |
6242
echo "$( jq '.version = "0.0.0"' package.json )" > package.json
6343
echo -e "---\n$( jq .name package.json ): patch\n---\n\nFake entry to force publishing" > .changeset/force-snapshot-release.md
64-
yarn changeset version --snapshot
65-
yarn changeset publish --tag canary
44+
npx changeset version --snapshot
45+
npx changeset publish --tag canary
6646
env:
6747
GITHUB_TOKEN: ${{ secrets.github_token }}
6848

@@ -80,4 +60,5 @@ jobs:
8060
description: package.version,
8161
target_url: `https://unpkg.com/${package.name}@${package.version}/`
8262
})
83-
- uses: primer/.github/.github/actions/upload-versions@main
63+
- name: Upload Versions
64+
uses: primer/.github/.github/actions/upload-versions@main

.github/workflows/release_candidate.yml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@ on:
1414
node_version:
1515
type: number
1616
required: false
17-
default: 16
18-
use_gpr:
19-
type: boolean
20-
required: false
21-
default: false
17+
default: 24
2218
secrets:
2319
gh_token:
2420
required: true
25-
npm_token:
26-
required: true
2721

2822
jobs:
2923
release-candidate:
@@ -39,33 +33,19 @@ jobs:
3933
- name: Set up Node
4034
uses: actions/setup-node@v6
4135
with:
42-
node_version: ${{ inputs.node_version }}
36+
node-version: ${{ inputs.node_version }}
4337

4438
- name: Install dependencies
4539
run: ${{ inputs.install }}
4640

4741
- name: Build
4842
run: npm run build --if-present
4943

50-
- name: Create .npmrc
51-
run: |
52-
if [ "$use_gpr" = "true" ]; then
53-
registry="//npm.pkg.github.com/"
54-
else
55-
registry="//registry.npmjs.org/"
56-
fi
57-
cat << EOF > "$HOME/.npmrc"
58-
$registry:_authToken=$NPM_TOKEN
59-
EOF
60-
env:
61-
use_gpr: ${{ inputs.use_gpr }}
62-
NPM_TOKEN: ${{ secrets.npm_token }}
63-
6444
- name: Publish release candidate
6545
run: |
6646
version=$(jq -r .version package.json)
6747
echo "$( jq ".version = \"$(echo $version)-rc.$(git rev-parse --short HEAD)\"" package.json )" > package.json
68-
yarn changeset publish --tag ${{ inputs.tag }}
48+
npx changeset publish --tag ${{ inputs.tag }}
6949
env:
7050
GITHUB_TOKEN: ${{ secrets.gh_token }}
7151

@@ -83,4 +63,5 @@ jobs:
8363
description: package.version,
8464
target_url: `https://unpkg.com/${package.name}@${package.version}/`
8565
})
86-
- uses: primer/.github/.github/actions/upload-versions@main
66+
- name: Upload Versions
67+
uses: primer/.github/.github/actions/upload-versions@main

workflow-templates/release_canary.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ on:
44
push:
55
branches-ignore:
66
- $default-branch
7-
- 'changeset-release/main'
7+
- "changeset-release/main"
88

99
jobs:
1010
release-canary:
1111
name: Canary
1212
uses: primer/.github/.github/workflows/release_canary.yml@v1.0.0
1313
secrets:
1414
gh_token: ${{ secrets.GITHUB_TOKEN }}
15-
npm_token: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}

workflow-templates/release_candidate.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ jobs:
1111
uses: primer/.github/.github/workflows/release_candidate.yml@v1.0.0
1212
secrets:
1313
gh_token: ${{ secrets.GITHUB_TOKEN }}
14-
npm_token: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}

0 commit comments

Comments
 (0)