-
Notifications
You must be signed in to change notification settings - Fork 59
95 lines (79 loc) · 2.74 KB
/
Copy pathcontinuous-releases.yml
File metadata and controls
95 lines (79 loc) · 2.74 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Continuous Releases
on:
issue_comment:
types: [created]
jobs:
release:
name: Release Seed Design Packages
if: |
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/snapshot') &&
contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add reaction
uses: actions/github-script@v9
with:
script: |
github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes'
});
- name: Checkout PR branch
uses: actions/checkout@v6
with:
ref: refs/pull/${{ github.event.issue.number }}/head
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun packages:build
- name: Publish
run: bunx pkg-pr-new publish './packages/*' './packages/react-headless/*' './packages/utils/*' --compact --comment=off --json output.json
- name: Comment on PR
uses: actions/github-script@v9
with:
script: |
const fs = require('fs');
const output = JSON.parse(fs.readFileSync('output.json', 'utf8'));
const packages = output.packages
.map(p => `\`${p.name}\`: \`${p.url}\``)
.join('\n');
const body = `## 📦 Snapshot Release
${packages}
> Triggered by @${{ github.event.comment.user.login }} via \`/snapshot\`
`.replace(/^ +/gm, '');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.issue.number }},
body
});
- name: Add success reaction
if: success()
uses: actions/github-script@v9
with:
script: |
github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'rocket'
});
- name: Add failure reaction
if: failure()
uses: actions/github-script@v9
with:
script: |
github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: '-1'
});