-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.43 KB
/
ci.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
name: CI build
on:
pull_request:
branches: # Run the workflow for pull requests that target main branch
- main
workflow_dispatch: # Allow running the workflow manually from the GitHub UI
jobs:
init:
runs-on: ubuntu-latest
outputs:
build-version: ${{ steps.set_build_version.outputs.build-version }}
steps:
- uses: actions/checkout@v4
- name: Get current version from changelog
id: get_current_version
uses: release-flow/keep-a-changelog-action@v2
with:
command: query
version: latest-or-unreleased
- name: Parse current version number
uses: madhead/semver-utils@v4
id: semver_parser
with:
# Parse the latest release version, or a default value if nothing is released
version: >
${{ steps.get_current_version.outputs.version != '[unreleased]'
&& steps.get_current_version.outputs.version
|| '0.0.0-ci.0' }}
- name: Set build version number
id: set_build_version
run: |
build_version='${{ steps.semver_parser.outputs.inc-prerelease }}'
if [[ -f $GITHUB_OUTPUT ]]; then
echo "build-version=$build_version" >> $GITHUB_OUTPUT
else
echo "::set-output name=build-version::$build_version"
fi
build:
needs: init
uses: ./.github/workflows/build-and-test.yml
with:
build-version: ${{ needs.init.outputs.build-version }}