-
Notifications
You must be signed in to change notification settings - Fork 8
141 lines (116 loc) · 4.07 KB
/
make-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
141
name: Release
permissions:
contents: write
on:
push:
tags:
- "[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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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/git-version@80c816f11db8dea5e3a81025f598193015b51832 # 2.8.0
with:
minor-identifier: "feat:"
release-branch: ${{ github.ref_name }}-pre
dev-branch: ${{ steps.rev.outputs.current-branch }}
- name: Generate Release Version
id: release
uses: codacy/git-version@80c816f11db8dea5e3a81025f598193015b51832 # 2.8.0
with:
minor-identifier: "feat:"
release-branch: ${{ steps.rev.outputs.current-branch }}
dev-branch: main
- name: Put versions in step summary
run: |
echo SNAPSHOT => ${{ steps.snapshot.outputs.version }} >> $GITHUB_STEP_SUMMARY
echo RELASE => ${{ steps.release.outputs.version }} >> $GITHUB_STEP_SUMMARY
- name: Validate tag
run : test ${{ steps.release.outputs.version }} == ${{ github.ref_name }}
- name: Delete tag if invalid
if: failure() || cancelled()
run : git push origin -d ${{ github.ref_name }}
images:
runs-on: ubuntu-latest
needs:
- versionning
env:
VERSION: ${{ needs.versionning.outputs.release }}
strategy:
fail-fast: true
matrix:
type:
- build-core
- buildBenchClient
- worker=bench buildWorker
- buildStreamClient
- worker=stream buildWorker
- buildHtcmockClient
- worker=htcmock buildWorker
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.ref }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
- name: Setup just
run: sudo snap install --edge --classic just
- name: login
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_LOGIN }} --password-stdin
- name: Build
run: just tag=$VERSION platform=linux/arm64,linux/amd64,windows/amd64 load=false push=true ${{ matrix.type }}
publish-nuget:
runs-on: ubuntu-latest
needs:
- versionning
env:
VERSION: ${{ needs.versionning.outputs.release }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.ref }}
- name: Build the package
run: |
dotnet build Base/src/ArmoniK.Core.Base.csproj -c Release
- name: Pack the package
run: |
dotnet pack Base/src/ArmoniK.Core.Base.csproj -c Release -o /tmp/packages -p:PackageVersion=$VERSION -p:Version=$VERSION
- name: Push the package
run: dotnet nuget push /tmp/packages/ArmoniK.Core.*.nupkg -k ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
update-changelog:
runs-on: ubuntu-latest
needs:
- versionning
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: 18
- run: npx @aneoconsultingfr/order-github-release-notes
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}