-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.69 KB
/
release.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
57
58
59
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Create Github Token as Changesets-Bot
id: create_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CHANGESETS_RELEASE_APP_ID }}
private-key: ${{ secrets.CHANGESETS_RELEASE_PRIVATE_KEY }}
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
token: ${{ steps.create_token.outputs.token }}
- name: Setup git user as Changesets Bot
# The bot id is taken from https://api.github.com/users/changesets-release-app[bot]
run: |
git config --global user.name "changesets-release-app[bot]"
git config --global user.email "152388490+changesets-release-app[bot]@users.noreply.github.com"
- name: Setup pnpm and node
uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
- name: Install Dependencies
run: pnpm install
- name: Build package
run: pnpm build
- name: Changesets Release
uses: changesets/action@v1
with:
commit: "chore(release): Release latest changesets"
title: "chore(release): Release latest changesets"
setupGitUser: false
createGithubReleases: true
publish: pnpm changeset publish
env:
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}