-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (64 loc) · 1.76 KB
/
release.yml
File metadata and controls
79 lines (64 loc) · 1.76 KB
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
name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
nightly:
timeout-minutes: 30
permissions:
contents: write
name: Release
runs-on: ubuntu-latest
env:
ADO_ORG: ${{ secrets.ADO_ORG }}
ADO_TOKEN: ${{ secrets.ADO_TOKEN }}
steps:
- name: Read release tag
run: |
if [ "$GITHUB_EVENT_NAME" == 'workflow_dispatch' ]; then
echo "RELEASE_TAG=master" >> "$GITHUB_ENV"
else
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV"
fi
- name: Derive version
run: |
echo "VERSION=${RELEASE_TAG#v}" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- name: Fetch tags
run: |
git fetch --tags -f
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'oracle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew :migration-app:buildDistZip
- name: Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
prerelease: false
draft: true
artifacts: migration-app/build/dist/*.zip
- name: Trigger version update
run: |
payload=$(cat <<EOF
{
"templateParameters": {
"version": "$VERSION"
}
}
EOF
)
curl -X POST \
-H "Content-Type: application/json" \
-u ":$ADO_TOKEN" \
-d "$payload" \
"https://dev.azure.com/$ADO_ORG/migration/_apis/pipelines/2399/runs?api-version=7.1-preview.1"