forked from PrairieLearn/PrairieLearn
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 2.01 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (51 loc) · 2.01 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
name: Release
on:
push:
branches:
- 'master'
# Avoid concurrent version-PR updates or package publish attempts.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
if: github.repository == 'PrairieLearn/PrairieLearn'
runs-on: ubuntu-latest
permissions:
contents: read
# Needed for OIDC trusted publishing
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Changesets needs the full history to generate changelogs with the correct commits.
fetch-depth: 0
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- name: Set up Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24'
package-manager-cache: false
- name: Install dependencies
run: pnpm install --frozen-lockfile
# The App token allows checks to run automatically on the pull request created below.
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.CI_BOT_APP_ID }}
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: Create release pull request or publish to npm
uses: changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1
with:
# Updating versions must be followed by an install to update pnpm-lock.yaml.
version-script: pnpm run version
publish-script: pnpm run release
github-token: ${{ steps.generate-token.outputs.token }}
# PrairieLearn does not use per-package GitHub releases or remote package tags.
create-github-releases: false
push-git-tags: false