-
Notifications
You must be signed in to change notification settings - Fork 21
58 lines (50 loc) · 1.46 KB
/
cd-integration.yml
File metadata and controls
58 lines (50 loc) · 1.46 KB
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
name: Build, Gates and Pull Request
on:
pull_request:
branches:
- develop
types:
- closed
permissions:
contents: write
pull-requests: write
jobs:
variables:
if: ${{ github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.environment.outputs.version }}
target-branch: ${{ steps.environment.outputs.target-branch }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "corretto"
cache: "maven"
- id: environment
name: Set output environment passed to the reusable workflow
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | grep -e '^[^\[]' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "target-branch=release/$VERSION" >> $GITHUB_OUTPUT
ci:
needs: variables
uses: ./.github/workflows/ci-maven.yml
secrets: inherit
gates:
needs: ci
if: success()
uses: ./.github/workflows/ci-gates.yml
secrets: inherit
pull-request:
needs: [gates, variables]
uses: ./.github/workflows/ci-pull-request.yml
secrets: inherit
with:
type: Snapshot
labels: automatic,snapshot
source-branch: master
target-branch: ${{ needs.variables.outputs.target-branch }}