-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.68 KB
/
release-canary.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
56
57
58
59
60
61
name: Release Canary
on:
pull_request:
types: [labeled]
branches: ["*"]
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
works:
name: I work
runs-on: ubuntu-latest
steps:
- run: echo "I work"
release:
name: Release
timeout-minutes: 10
runs-on: ubuntu-latest
permissions: write-all
if: contains(github.event.pull_request.labels.*.name, 'release canary')
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: pnpm/action-setup@v4
with:
run_install: |
- recursive: true
args: [--no-frozen-lockfile]
- name: Publish a Canary version
id: publish
run: |
pnpm changeset version --snapshot ${{ github.event.number }}
pnpm -w publish --access public --tag canary --no-git-checks
echo "published=true" >> "$GITHUB_OUTPUT"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
- name: Comment on PR
if: steps.publish.outputs.published == 'true'
uses: actions/github-script@v3
with:
github-token: ${{ secrets.MY_GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `
🚀 Successfully released canary version to npm.
You can install it by running:
\`\`\`
pnpm add eslint-plugin-rtl@canary
\`\`\`
`.replace(/^\s+|\s+$/g, '')
})