This repository was archived by the owner on May 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
76 lines (65 loc) · 2.16 KB
/
release.yml
File metadata and controls
76 lines (65 loc) · 2.16 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
# Release packages to NPM and GitHub.
name: Release
on:
workflow_dispatch:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i
- name: Create bump PR or release version
uses: changesets/action@v1
id: changesets
with:
publish: pnpm run release:packages
title: "bump: assumable rgbpp-sdk version"
commit: "bump: assumable rgbpp-sdk version"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create comment on commit
uses: actions/github-script@v7
if: steps.changesets.outputs.published
env:
PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
with:
script: |
const packages = JSON.parse(process.env.PACKAGES)
const packagesTable = packages.map((p) => `| ${p.name} | \`${p.version}\` |`).join('\n')
const body = ['New official version of the rgbpp-sdk packages have been released:', '| Name | Version |', '| --- | --- |', packagesTable].join('\n')
github.rest.repos.createCommitComment({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
body: body,
});