-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.35 KB
/
main.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
# Workflow to run on the main branch
name: main QA and release
on:
push:
branches:
- main
jobs:
test:
uses: ./.github/workflows/test.yml
release:
needs: [test]
runs-on: ubuntu-latest
outputs:
new_tag_version: ${{ steps.tag_version.outputs.new_tag_version }}
steps:
- name: Checkout 🛎
uses: actions/checkout@master
- name: Setup node env 🏗
uses: actions/setup-node@v4
with:
node-version: 18
check-latest: true
- name: Install dependencies 👨🏻
run: yarn install
- name: Dry run to get the next release version
id: tag_version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export NEXT_TAG_VERSION=$(npx semantic-release --dry-run | grep 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
echo "new_tag_version=${NEXT_TAG_VERSION}" >> $GITHUB_OUTPUT
- name: Release 🚀
run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Version
run: echo "The version is ${{ steps.tag_version.outputs.new_tag_version }}"
- name: Build and publish
uses: ./.github/workflows/docker-build.yml
with:
push: true
version: ${{ steps.tag_version.outputs.new_tag_version }}