-
Notifications
You must be signed in to change notification settings - Fork 8
111 lines (102 loc) · 3.68 KB
/
build-all.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
105
106
107
108
109
110
111
name: Build all configurations and deploy
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8' ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Set settings.xml
uses: s4u/[email protected]
with:
servers: |
[{
"id": "msf-ocg-github-lime-emr",
"username": "${{ secrets.MAVEN_GITHUB_ACTIONS_DEPLOY_USERNAME }}",
"password": "${{ secrets.MAVEN_GITHUB_ACTIONS_DEPLOY_TOKEN }}"
}]
- name: Build and Test
run: mvn --batch-mode --update-snapshots --activate-profiles validator clean package
release:
runs-on: ubuntu-latest
needs: build
outputs:
directories: ${{ steps.check_dir.outputs.directories }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Trigger build job based on directory
id: check_dir
run: |
if [[ $(git diff --name-only ${{ github.event.before }} ${{ github.sha }}) == *"distro"* ]]; then
echo "Triggering the 'release-distro' job and its children"
DIRECTORIES=("distro", "iraq", "mosul")
echo "directories=${DIRECTORIES}" >> $GITHUB_OUTPUT
elif [[ $(git diff --name-only ${{ github.event.before }} ${{ github.sha }}) == *"iraq"* ]]; then
echo "Triggering the 'release-iraq' job and its children"
DIRECTORIES=("iraq", "mosul")
echo "directories=${DIRECTORIES}" >> $GITHUB_OUTPUT
elif [[ $(git diff --name-only ${{ github.event.before }} ${{ github.sha }}) == *"mosul"* ]]; then
echo "Triggering the 'release-mosul' job"
DIRECTORIES=("mosul")
echo "directories=${DIRECTORIES}" >> $GITHUB_OUTPUT
else
echo "No relevant directory changes, skipping build job"
DIRECTORIES=()
echo "directories=${DIRECTORIES}" >> $GITHUB_OUTPUT
fi
release-distro:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Publish MSF distro artifacts to GitHub
uses: ./.github/actions/upload-maven-artifacts
with:
artifact-name: "distro"
artifact-path: "${{ github.workspace }}/distro"
maven-server-username: "${{ secrets.MAVEN_GITHUB_ACTIONS_DEPLOY_USERNAME }}"
maven-server-token: "${{ secrets.MAVEN_GITHUB_ACTIONS_DEPLOY_TOKEN }}"
release-iraq:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Publish MSF Mosul to artifacts GitHub
uses: ./.github/actions/upload-maven-artifacts
with:
artifact-name: "Iraq"
artifact-path: "${{ github.workspace }}/countries/iraq"
maven-server-username: "${{ secrets.MAVEN_GITHUB_ACTIONS_DEPLOY_USERNAME }}"
maven-server-token: "${{ secrets.MAVEN_GITHUB_ACTIONS_DEPLOY_TOKEN }}"
release-mosul:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Publish MSF Iraq artifacts to GitHub
uses: ./.github/actions/upload-maven-artifacts
with:
artifact-name: "Mosul"
artifact-path: "${{ github.workspace }}/sites/mosul"
maven-server-username: "${{ secrets.MAVEN_GITHUB_ACTIONS_DEPLOY_USERNAME }}"
maven-server-token: "${{ secrets.MAVEN_GITHUB_ACTIONS_DEPLOY_TOKEN }}"