-
Notifications
You must be signed in to change notification settings - Fork 7
49 lines (43 loc) · 1.46 KB
/
semantic_versioning.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
name: Automatic semantic versioning
on:
push:
branches: [main, develop, alpha, beta]
jobs:
versioning:
name: Semantic versioning
runs-on: ubuntu-latest
outputs:
current_version: ${{ steps.current_version.outputs.CURRENT_VERSION }}
next_version: ${{ steps.next_version.outputs.NEXT_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Setting up node
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
registry-url: 'https://npm.pkg.github.com'
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Install plugins
run: yarn add -D @semantic-release/changelog @semantic-release/git @semantic-release/exec -W
- name: Print current version
id: current_version
run: echo "CURRENT_VERSION=$(jq -r ".version" ./package.json)" >> $GITHUB_OUTPUT;
- name: Run semantic release
id: next_version
run: yarn semantic-release --extends ./releaserc.json
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
print:
needs: versioning
runs-on: ubuntu-latest
steps:
- name: Print version numbers
run: |
echo "Current version is: ${{ needs.versioning.outputs.CURRENT_VERSION }}"
echo "Next version is: ${{ needs.versioning.outputs.NEXT_VERSION }}"