Skip to content

Commit 9ad3509

Browse files
committed
Revert "ci: use npm trusted publishing"
This reverts commit 1bc5703.
1 parent 6f3abbc commit 9ad3509

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

.github/workflows/changesets.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,16 @@ jobs:
6666
version: pnpm changeset:version
6767
env:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6970

7071
- name: Publish Prerelease
7172
if: steps.changesets.outputs.published != 'true'
7273
continue-on-error: true
7374
env:
75+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7476
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7577
run: |
78+
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
7679
git reset --hard origin/main
7780
pnpm clean
7881
pnpm changeset version --no-git-tag --snapshot canary

.github/workflows/prune-tags.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Prune NPM tags
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
jobs:
8+
prune:
9+
name: Prune NPM tags
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone repository
13+
uses: actions/checkout@v4
14+
with:
15+
submodules: 'recursive'
16+
17+
- name: Setup .npmrc file
18+
uses: actions/setup-node@v4
19+
with:
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Prune tags
23+
run: cd src && npm view --json | jq -r '.["viem"] | .["dist-tags"] | to_entries | .[] | select(.key != "latest") | select(.key != "canary") | .key' | xargs -I % npm dist-tag rm viem %
24+
env:
25+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/snapshot.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Snapshot
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
canary:
7+
name: Release snapshot version
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
id-token: write
12+
timeout-minutes: 5
13+
14+
steps:
15+
- name: Clone repository
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: 'recursive'
19+
20+
- name: Install dependencies
21+
uses: ./.github/actions/install-dependencies
22+
23+
- name: Publish Snapshots
24+
continue-on-error: true
25+
env:
26+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
snapshot=$(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
30+
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
31+
pnpm clean
32+
pnpm changeset version --no-git-tag --snapshot $snapshot
33+
pnpm changeset:prepublish
34+
pnpm changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot
35+

0 commit comments

Comments
 (0)