This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.64 KB
/
version.yaml
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
name: Version
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
version:
if: startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.semver.outputs.nextStrict }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout PR
id: getpr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
export PR_BRANCH=$(git branch --show-current)
echo "branch=$PR_BRANCH" >> $GITHUB_OUTPUT
- name: Get Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: ${{ steps.getpr.outputs.branch }}
- name: Set JS Version (vue3)
uses: KageKirin/set-node-package-version@v1
with:
file: vue3/package.json
version: ${{ steps.semver.outputs.nextStrict }}
- name: Set JS Version (vue2)
uses: KageKirin/set-node-package-version@v1
with:
file: vue2/package.json
version: ${{ steps.semver.outputs.nextStrict }}
- name: Commit Changes
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GH Action"
git add vue2/package.json
git add vue3/package.json
git commit -m 'version bump'
git push