-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.59 KB
/
release.yml
File metadata and controls
62 lines (55 loc) · 1.59 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
name: "Release"
on:
schedule:
- cron: "0 0 * * 2,4"
push:
branches:
- main
permissions:
id-token: write
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Build package
run: yarn build
- name: Generate types
run: yarn generate:types
- name: Commit generated types
id: commit_types
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
if git diff --staged --quiet; then
echo "No changes to generated types"
echo "types_changed=false" >> $GITHUB_OUTPUT
else
git commit -m "feat: regenerate GraphQL types"
git push
echo "types_changed=true" >> $GITHUB_OUTPUT
fi
- name: Semantic release
# Skip if we just pushed a commit — semantic-release will run again
# on the push trigger from that commit
if: steps.commit_types.outputs.types_changed == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release