Repository navigation
116 lines (101 loc) · 3.81 KB
/
Copy pathchangesets.yml
File metadata and controls
116 lines (101 loc) · 3.81 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
116
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/wagmi'
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8
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@2a55cccb5234b9fa0bbd87c1eaba45571c466a68
with:
node-version: 24.5
skip-cache: true # avoid cache poisoning attacks
- name: Create version pull request
id: changesets
uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.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/wagmi' && 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Install dependencies
uses: wevm/actions/.github/actions/pnpm@2a55cccb5234b9fa0bbd87c1eaba45571c466a68
with:
node-version: 24.5
skip-cache: true # avoid cache poisoning attacks
- name: Publish to npm
id: publish
uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.0
with:
createGithubReleases: true
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
canary:
name: Canary release
needs: [verify, changesets]
# prevents this action from running on forks
if: github.repository == 'wevm/wagmi' && 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Install dependencies
uses: wevm/actions/.github/actions/pnpm@2a55cccb5234b9fa0bbd87c1eaba45571c466a68
with:
node-version: 24.5
skip-cache: true # avoid cache poisoning attacks
- name: Publish snapshot packages
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm changeset version --no-git-tag --snapshot canary
pnpm changeset:prepublish
pnpm changeset publish --no-git-tag --snapshot canary --tag canary