-
-
Notifications
You must be signed in to change notification settings - Fork 34
61 lines (59 loc) · 2.47 KB
/
beta.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: Beta
on: pull_request
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Find Comment
uses: peter-evans/find-comment@v1
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Farfetched Beta
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
registry-url: 'https://npm.pkg.github.com'
scope: '@igorkamyshev'
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
shell: sh
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- run: node ./tools/scripts/restore_beta_version.mjs ${{ steps.extract_branch.outputs.branch }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm changeset pre enter ${{ steps.extract_branch.outputs.branch }}
- run: pnpm changeset version
- run: pnpm changeset pre exit
- run: node ./tools/scripts/beta_required.mjs '${{ steps.find_comment.outputs.comment-body }}' >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
id: beta_required
- run: pnpm nx run-many --output-style=static --target=publish --all --configuration=beta
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: What happened with Changes
shell: bash
run: node ./tools/scripts/beta_info.mjs >> $GITHUB_OUTPUT && cat $GITHUB_OUTPUT
id: beta_info
- name: Create comment
if: steps.find_comment.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Farfetched Beta: Latest published version is `${{ steps.beta_info.outputs.betaVersion }}`
Used changeset: `${{ steps.beta_info.outputs.usedChangesets }}`
- name: Update comment
if: steps.find_comment.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v1
with:
edit-mode: replace
comment-id: ${{ steps.find_comment.outputs.comment-id }}
body: |
Farfetched Beta: Latest published version is `${{ steps.beta_info.outputs.betaVersion }}`
Used changeset: `${{ steps.beta_info.outputs.usedChangesets }}`