-
Notifications
You must be signed in to change notification settings - Fork 210
81 lines (81 loc) · 2.59 KB
/
build-test-and-publish-ce.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
name: Build, test, and publish CE
on: [pull_request, push, workflow_dispatch]
jobs:
build-and-test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
DISTRO: [tomcat, wildfly, run]
PLATFORM: [amd64, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: ${{ matrix.PLATFORM != 'amd64' }}
with:
platforms: ${{ matrix.PLATFORM }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Expose GitHub Runtime
uses: actions/github-script@v7
with:
script: |
Object.keys(process.env).forEach(function (key) {
if (key.startsWith('ACTIONS_')) {
core.info(`${key}=${process.env[key]}`);
core.exportVariable(key, process.env[key]);
}
});
- name: Build
run: ./pipeline.sh
env:
DISTRO: ${{ matrix.DISTRO }}
EE: false
PLATFORM: ${{ matrix.PLATFORM }}
NEXUS_PASS: ${{ secrets.NEXUS_PASS }}
NEXUS_USER: ${{ secrets.NEXUS_USER }}
- name: Test
run: ./test.sh
working-directory: test
env:
DISTRO: ${{ matrix.DISTRO }}
EE: false
PLATFORM: ${{ matrix.PLATFORM }}
publish:
runs-on: ubuntu-20.04
needs: build-and-test
if: ${{ github.ref == 'refs/heads/next' || startsWith(github.ref, 'refs/heads/7.') }}
strategy:
matrix:
DISTRO: [tomcat, wildfly, run]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64,amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Expose GitHub Runtime
uses: actions/github-script@v7
with:
script: |
Object.keys(process.env).forEach(function (key) {
if (key.startsWith('ACTIONS_')) {
core.info(`${key}=${process.env[key]}`);
core.exportVariable(key, process.env[key]);
}
});
- name: Publish multi-platform images
run: ./release.sh
env:
DISTRO: ${{ matrix.DISTRO }}
EE: false
PLATFORMS: linux/arm64,linux/amd64
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
NEXUS_PASS: ${{ secrets.NEXUS_PASS }}
NEXUS_USER: ${{ secrets.NEXUS_USER }}