-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (94 loc) · 3.47 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Build
on:
push:
branches:
- develop
pull_request:
branches:
- develop
types:
- opened
- reopened
- synchronize
- labeled
env:
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_CLI_OPTS: >-
--settings settings.xml
-V --no-transfer-progress -Dspring.main.banner-mode=off -Ddoclint=none
-Denvironment.host=${{ vars.ENVIRONMENT_HOST }}
-Denvironment.apa.host=${{ vars.ENVIRONMENT_APA_HOST }}
-Denvironment.application.name=${{ vars.ENVIRONMENT_APP }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }}
cancel-in-progress: true
jobs:
pre-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Check dependabot build
uses: Activiti/Activiti/.github/actions/check-ext-build@7700f0283a9ff5181581a350d2520e55c61c1c60 # 8.6.0
- name: pre-commit
uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@c2ebfbb418295b18eca057303a5881324be0de42 # v8.6.2
with:
skip_checkout: true
- name: Ensure SHA pinned actions
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@5d6ac37a4cef8b8df67f482a8e384987766f0213 # v3.0.17
build:
runs-on: ubuntu-latest
needs:
- pre-checks
outputs:
version: ${{ steps.build-and-tag.outputs.version }}
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/maven-build-and-tag@c2ebfbb418295b18eca057303a5881324be0de42 # v8.6.2
id: build-and-tag
with:
upload-jars: 'true'
extra-maven-opts: -T 1C -DunitTests.parallel=true
maven-username: ${{ secrets.NEXUS_USERNAME }}
maven-password: ${{ secrets.NEXUS_PASSWORD }}
quay-username: ${{ secrets.QUAY_USERNAME }}
quay-password: ${{ secrets.QUAY_PASSWORD }}
docker-username: ${{ secrets.DOCKER_USERNAME }}
docker-password: ${{ secrets.DOCKER_PASSWORD }}
git-username: ${{ secrets.BOT_GITHUB_USERNAME }}
java-version: '21'
promote:
runs-on: ubuntu-latest
needs:
- build
if: github.event_name == 'push'
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Extract version from branch name
id: extract_version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Project version is $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create GitHub tag
if: ${{ !endsWith(env.VERSION, 'SNAPSHOT') }}
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
run: |
git tag ${{ env.VERSION }}
git push origin ${{ env.VERSION }}
- name: Create gh Release
if: ${{ !endsWith(env.VERSION, 'SNAPSHOT') }}
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
run: |
gh release create ${VERSION} --title ${VERSION} --notes "Release ${VERSION}"
notify:
runs-on: ubuntu-latest
needs:
- promote
if: always() && failure() && github.event_name == 'push'
steps:
- name: Teams Notification
uses: Alfresco/alfresco-build-tools/.github/actions/send-teams-notification@c2ebfbb418295b18eca057303a5881324be0de42 # v8.6.2
with:
webhook-url: ${{ secrets.TEAMS_NOTIFICATION_AUTOMATE_BACKEND_WEBHOOK }}