-
-
Notifications
You must be signed in to change notification settings - Fork 529
72 lines (61 loc) · 2.1 KB
/
beta-release.yaml
File metadata and controls
72 lines (61 loc) · 2.1 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
name: Beta Release
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
beta_release:
if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
concurrency:
group: beta-release-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
id-token: write
issues: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Install dev dependencies
run: yarn install
- name: Setup git credentials
run: |
git config --global user.name 'Auto Release Bot'
git config --global user.email 'auto-release-bot@users.noreply.github.com'
- name: Get current package.json version
run: echo "PACKAGE_VERSION=$(npm pkg get version)" >> $GITHUB_ENV
- name: Setup Beta Release Version
run: node beta-release.js --issue $GITHUB_PR_NUMBER
env:
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Build package
run: npm run build
- uses: actions/setup-node@v4
with:
node-version: '22.14.0'
registry-url: 'https://registry.npmjs.org'
- name: Release a new beta version
run: npm publish --tag beta --access public --ignore-scripts
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Beta version released with the last commit 🚀
\`\`\`
yarn add react-tooltip@${{ env.NEW_VERSION }}
\`\`\`
or
\`\`\`
npm install react-tooltip@${{ env.NEW_VERSION }}
\`\`\`
`
})