-
-
Notifications
You must be signed in to change notification settings - Fork 21
55 lines (46 loc) · 1.55 KB
/
changeset-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
name: Changeset Release
on:
workflow_dispatch:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
# Updated as per: https://github.com/changesets/action/issues/387#issuecomment-2336411095
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup pnpm (corepack enabled)
uses: pnpm/action-setup@v3
- name: Setup Node.js 20.x
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm ci:install
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
setupGitUser: true
commit: "👷 [ci]: Version Packages"
title: "👷 [ci]: Ready for Release"
version: pnpm ci:version
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Add Label to CI PR
if: ${{ steps.changesets.outputs.hasChangesets == 'true' }}
run: gh pr edit "$PR_URL" --add-label "ci"
env:
PR_URL: ${{ steps.changesets.outputs.pull_request_url }}
GITHUB_TOKEN: ${{ secrets.STUDIOCMS_SERVICE_TOKEN }}