-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 2.93 KB
/
Copy pathrelease.yml
File metadata and controls
97 lines (81 loc) · 2.93 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
# Changesets release workflow using npm trusted publishing (OIDC).
#
# Pushes to main create or update a "chore: release packages" pull request.
# Merging that pull request publishes every version ahead of npm.
#
# New npm package names need one authenticated bootstrap release because npm
# requires a package to exist before a trusted publisher can be configured.
# For that first release only, add a short-lived repository NPM_TOKEN secret.
# Remove it after publication and configure each package's trusted publisher as:
# org=graphrefly, repo=graphrefly-react, workflow=release.yml
name: Release
on:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: release-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
name: Release
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Create GitHub App installation token
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.GRAPHREFLY_WRITE_CONTENT_APP_CLIENT_ID }}
private-key: ${{ secrets.GRAPHREFLY_WRITE_CONTENT_APP_PRIVATE_KEY }}
permission-contents: write
permission-issues: write
permission-pull-requests: write
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
persist-credentials: true
- name: Configure Git committer
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
user_id=$(gh api "users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)
git config user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config user.email "${user_id}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com"
- name: Setup pnpm
uses: pnpm/action-setup@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm run lint
- name: Typecheck
run: pnpm run typecheck
- name: Test packages
run: pnpm run test:all
- name: Build packages
run: pnpm run build:all
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
version: pnpm run version-packages
commit: "chore: release packages"
title: "chore: release packages"
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}