-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.57 KB
/
cicd_pipeline.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
name: "CI/CD Pipeline"
on:
push:
branches:
- 'main'
- 'release/**'
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
- labeled
concurrency:
group: cicd-pipeline-${{ github.workflow }}-${{ github.event.pull_request.number || github.event.pull_request.head.ref || github.ref }}
jobs:
build:
if: |
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'CI: Build')) ||
github.event_name == 'push'
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.set_version.outputs.safe_version }}
permissions:
contents: write
steps:
-
uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
-
uses: actions/checkout@v3
if: github.event_name == 'push'
with:
fetch-depth: 0
-
name: Set application version
id: set_version
uses: kvendingoldo/[email protected]
with:
primary_branch: main
enable_github_releases: true
release_tag_prefix: "v"
github_token: "${{ secrets.GITHUB_TOKEN }}"
tag_prefix: "test/"
-
name: Generated version
run: echo ${{ steps.set_version.outputs.version }}
-
name: Safe version
run: echo ${{ steps.set_version.outputs.safe_version }}
-
name: Java version
run: echo ${{ steps.set_version.outputs.java_version }}