-
-
Notifications
You must be signed in to change notification settings - Fork 71
115 lines (100 loc) · 3.74 KB
/
Copy pathchangesets.yml
File metadata and controls
115 lines (100 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Changesets
on:
push:
branches: [main]
permissions: {} # each job should declare only the permissions it needs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
verify:
name: Verify
permissions:
contents: write # commit formatting updates in the reusable workflow
uses: ./.github/workflows/verify.yml
secrets: inherit
changesets:
name: Changesets
needs: verify
# prevents this action from running on forks
if: github.repository == 'wevm/abitype'
permissions:
contents: write # commit version/changelog updates to the release pull request
pull-requests: write # create or update the Changesets release pull request
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
steps:
- name: Clone repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Install dependencies
uses: wevm/actions/.github/actions/pnpm@f95dc1dadcba18fe3f02b8205e653e98e4a93516
with:
node-version: 24.5
skip-cache: true # avoid cache poisoning attacks
- name: Create version pull request
id: changesets
uses: changesets/action@c48e67d110a68bc90ccf1098e9646092baacaa87 # v1.6.0
with:
title: 'chore: version packages'
commit: 'chore: version packages'
version: pnpm changeset:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
needs: [verify, changesets]
# prevents this action from running on forks
if: github.repository == 'wevm/abitype' && needs.changesets.outputs.hasChangesets == 'false'
permissions:
contents: write # create GitHub releases and tags after npm publish
id-token: write # authenticate to npm via trusted publishing
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
published: ${{ steps.publish.outputs.published }}
steps:
- name: Clone repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
uses: wevm/actions/.github/actions/pnpm@f95dc1dadcba18fe3f02b8205e653e98e4a93516
with:
node-version: 24.5
skip-cache: true # avoid cache poisoning attacks
- name: Publish to npm
id: publish
uses: changesets/action@c48e67d110a68bc90ccf1098e9646092baacaa87 # v1.6.0
with:
createGithubReleases: true
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
prerelease:
name: Prerelease
needs: [verify, changesets]
# prevents this action from running on forks
if: github.repository == 'wevm/abitype' && needs.changesets.outputs.hasChangesets == 'true'
permissions:
contents: read # checkout repository contents
id-token: write # authenticate to npm via trusted publishing
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Clone repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
uses: wevm/actions/.github/actions/pnpm@f95dc1dadcba18fe3f02b8205e653e98e4a93516
with:
node-version: 24.5
skip-cache: true # avoid cache poisoning attacks
- name: Publish prerelease
run: |
pnpm clean
pnpm changeset:prepublish
pnpx pkg-pr-new publish --pnpm --compact './packages/abitype'
env:
PKG_PR_NEW: true