This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (59 loc) · 1.97 KB
/
update-version.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
62
63
name: Update Version
on:
pull_request_target:
branches: [ development ]
jobs:
approve:
runs-on: ubuntu-latest
steps:
- name: Approve
run: echo For security reasons, all pull requests need to be approved first before running any automated CI.
publish:
runs-on: ubuntu-latest
needs: [approve]
environment:
name: Integrate Pull Request
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: "18"
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.11.0
- name: Install dependencies
run: pnpm install
- name: Update version
run: echo "::set-output name=version::$(node update-beta-version.mjs)"
id: update-version
- name: Build CLI
run: pnpm run build --filter ultra-pkg
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release --tag next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish release
uses: ncipollo/release-action@v1
with:
body: "This release was created by the GitHub Release Action."
name: ${{ steps.update-version.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
tag: ${{ steps.update-version.outputs.version }}
target: "development"
- name: Create comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.number }}
body: |
Published alpha release:
- Version: ${{ steps.update-version.outputs.version }}
- NPM URL: https://www.npmjs.com/package/ultra-pkg/v/${{ steps.update-version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}