-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.41 KB
/
nightly-build.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
name: SmartAPI | Nightly Builder
on:
push:
branches:
- '**'
workflow_dispatch:
jobs:
get-latest-version:
name: Get latest version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version-ready.outputs.release }}
steps:
- name: Get latest release version
if: github.event_name == 'push'
id: get-latest-version
uses: pozetroninc/[email protected]
with:
repository: ${{ github.repository }}
- name: Increment version
if: github.event_name == 'push'
id: increment-version
run: |
RELEASE_NAME=${{ steps.get-latest-version.outputs.release }}
echo "release=$(echo ${RELEASE_NAME#v} | awk -F. -v OFS=. '{$NF = $NF + 1;} 1')" >> "$GITHUB_OUTPUT"
- name: Set output
id: version-ready
run: |
if [[ "${{ github.ref_name}}" == "main" || "${{ github.ref_name }}" == "master" ]]; then
echo "release=${{ steps.increment-version.outputs.release }}" >> "$GITHUB_OUTPUT"
else
echo "release=${{ github.ref_name }}_${{ steps.increment-version.outputs.release }}" >> "$GITHUB_OUTPUT"
fi
build-nightly:
name: Build Nightly version
needs: get-latest-version
uses: ./.github/workflows/build.yml
with:
version: ${{ needs.get-latest-version.outputs.version }}-SNAPSHOT
isRelease: false