-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (58 loc) · 1.69 KB
/
bump_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
64
65
66
67
68
69
70
name: Build Version
on:
workflow_dispatch:
push:
branches:
- main
permissions:
actions: write
checks: write
contents: write
pull-requests: write
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: "unbound-mod/builds"
path: "builds"
token: ${{ secrets.ROSIE_TOKEN }}
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Setup Git User
run: |
git config --global user.email "${{ github.event.head_commit.author.email }}"
git config --global user.name "${{ github.event.head_commit.author.name }}"
- name: Bump Patch Version
if: ${{ !contains(github.event.head_commit.message, 'major') && !contains(github.event.head_commit.message, 'major') }}
run: |
pnpm version patch
- name: Bump Minor Version
if: contains(github.event.head_commit.message, 'patch')
run: |
pnpm version minor
- name: Bump Major Version
if: contains(github.event.head_commit.message, 'major')
run: |
pnpm version major
- name: Install dependencies
run: |
npm i -g pnpm
pnpm i
- name: Build bundle
run: |
cd $GITHUB_WORKSPACE
git submodule init
git submodule update --remote --merge
pnpm build
- name: Push to builds repo
run: |
rm -f $GITHUB_WORKSPACE/builds/*
cp -r dist/* $GITHUB_WORKSPACE/builds
cd $GITHUB_WORKSPACE/builds
git add .
git commit -m "$GITHUB_SHA" || exit 0
git push