-
Notifications
You must be signed in to change notification settings - Fork 7
140 lines (125 loc) · 4.64 KB
/
release.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Release
permissions:
contents: write
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
versionning:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.snapshot.outputs.version }}
release: ${{ steps.release.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Remove tag locally
# This is done so that codacy/git-version can compute the version of the images deployed on docker hub
run: |
git tag -d ${{ github.ref_name }}
- name: Compute branch for codacy
# This is the branch to give to codacy to compute the snapshot version
id: rev
run: |
export CURRENT_BRANCH=$(git describe --tags)
echo "current-branch=$CURRENT_BRANCH" >> $GITHUB_OUTPUT
- name: Generate Snapshot Version
id: snapshot
uses: codacy/[email protected]
with:
minor-identifier: "feat:"
release-branch: ${{ github.ref_name }}-pre
dev-branch: ${{ steps.rev.outputs.current-branch }}
prefix: v
- name: Generate Release Version
id: release
uses: codacy/[email protected]
with:
minor-identifier: "feat:"
release-branch: ${{ steps.rev.outputs.current-branch }}
dev-branch: main
prefix: v
- name: Put versions in step summary
run: |
echo SNAPSHOT => ${{ steps.snapshot.outputs.version }} >> $GITHUB_STEP_SUMMARY
echo RELEASE => ${{ steps.release.outputs.version }} >> $GITHUB_STEP_SUMMARY
buildImages:
runs-on: ubuntu-latest
needs:
- versionning
env:
VERSION: ${{ needs.versionning.outputs.version }}
RELEASE: ${{ needs.versionning.outputs.release }}
strategy:
fail-fast: true
matrix:
include:
- img : dockerhubaneo/armonik_demo_helloworld_worker
path : ./csharp/native/HelloWorld/Worker/Dockerfile
- img : dockerhubaneo/armonik_demo_helloworld_client
path : ./csharp/native/HelloWorld/Client/Dockerfile
- img : dockerhubaneo/armonik_demo_multipleresults_worker
path: ./csharp/native/MultipleResults/Worker/Dockerfile
- img : dockerhubaneo/armonik_demo_multipleresults_client
path : ./csharp/native/MultipleResults/Client/Dockerfile
- img : dockerhubaneo/armonik_demo_subtasking_worker
path: ./csharp/native/SubTasking/Worker/Dockerfile
- img : dockerhubaneo/armonik_demo_subtasking_client
path : ./csharp/native/SubTasking/Client/Dockerfile
- img : dockerhubaneo/armonik_demo_linearsubtasking_worker
path: ./csharp/native/LinearSubTasking/Worker/Dockerfile
- img : dockerhubaneo/armonik_demo_linearsubtasking_client
path : ./csharp/native/LinearSubTasking/Client/Dockerfile
- img : dockerhubaneo/armonik_demo_dynamicsubmission_worker
path: ./csharp/native/DynamicSubmission/Worker/Dockerfile
- img : dockerhubaneo/armonik_demo_dynamicsubmission_client
path : ./csharp/native/DynamicSubmission/Client/Dockerfile
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: ${{ github.ref }}
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3
- name: login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
username: ${{ secrets.DOCKER_HUB_LOGIN }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Build and push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
with:
file: ${{ matrix.path }}
context: ./csharp/native
platforms: |
linux/arm64
linux/amd64
push: true
tags: |
${{ matrix.img }}:${{ needs.versionning.outputs.release }}
${{ matrix.img }}:latest
buildProjects:
runs-on: ubuntu-latest
needs:
- versionning
env:
GENRELEASE: ${{ needs.versionning.outputs.release }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: ${{ github.ref }}
submodules: true
- name: Build the package
run: |
dotnet build AllSamples.sln -c Release -p:Version=$(echo $GENRELEASE | sed 's/^.//')