-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (49 loc) · 1.65 KB
/
upload-changesets.yml
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
name: Upload changesets
on:
release:
types:
- published
jobs:
upload-changesets:
name: Upload changesets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: 'Install pnpm'
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
with:
version: 9
run_install: true
- name: Upload an Asset in GitHub Release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./scripts/uploadChangesets.cjs')
script({github, context, token: '${{ secrets.GITHUB_TOKEN }}'})
cleanup-changesets:
runs-on: ubuntu-latest
needs: upload-changesets
environment: production
steps:
- name: 'Get token for the GitHub App'
if: ${{ vars.APP_ID != '' }}
uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: main
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
- name: Remove changesets zip files
run: rm .changeset/changesets-*.zip
- name: Commit changes
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5
with:
add: '.'
github_token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
message: 'chore(skip-ci): remove changesets zip files'