-
Notifications
You must be signed in to change notification settings - Fork 27
89 lines (77 loc) · 2.89 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
name: Build, Sign and Release
on:
push:
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
permissions:
contents: write
jobs:
build-macos:
uses: ./.github/workflows/release_macos.yml
with:
binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon
secrets: inherit
build-linux:
uses: ./.github/workflows/release_linux.yml
with:
binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon
secrets: inherit
build-windows:
uses: ./.github/workflows/release_windows.yml
with:
binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon
secrets: inherit
build-docker:
needs: [build-macos, build-linux, build-windows]
uses: ./.github/workflows/release_docker.yml
secrets: inherit
create-release:
needs: [build-macos, build-linux, build-windows, build-docker]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Generate Hashes
id: generate_hashes
run: |
echo "HASHES<<EOF" >> $GITHUB_OUTPUT
for file in Mintlayer*/*; do
if [ -f "$file" ]; then
echo "$(sha256sum $file | awk '{print $1}') $(basename $file)" >> $GITHUB_OUTPUT
fi
done
echo "EOF" >> $GITHUB_OUTPUT
- name: Generate Release Body
id: generate_body
run: |
echo "BODY<<EOF" >> $GITHUB_OUTPUT
echo "Release version ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "Please download the appropriate package for your system." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "Docker Images" >> $GITHUB_OUTPUT
echo "Find docker images in the docker hub:" >> $GITHUB_OUTPUT
echo "https://hub.docker.com/u/mintlayer" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "File Hashes (SHA256):" >> $GITHUB_OUTPUT
echo "\`\`\`" >> $GITHUB_OUTPUT
echo "${{ steps.generate_hashes.outputs.HASHES }}" >> $GITHUB_OUTPUT
echo "\`\`\`" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "Mintlayer*/*"
artifactErrorsFailBuild: true
name: "Release ${{ steps.get_version.outputs.VERSION }}"
body: ${{ steps.generate_body.outputs.BODY }}
token: ${{ secrets.GITHUB_TOKEN }}