-
Notifications
You must be signed in to change notification settings - Fork 19
98 lines (85 loc) · 3.53 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
name: Build Releases
on:
release:
types: [published]
push:
branches:
- 'feature/airgap-on-1.3.2'
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: "Create base filename for all artifacts"
id: basefn
shell: bash
run: |
FILENAME=$(echo rctab_${{ github.ref_name }}_${{ runner.os }}_${{ runner.arch }} | sed -e 's/\//_/g')
echo "FILENAME=$FILENAME" >> $GITHUB_OUTPUT
- name: "Create filename"
id: fn
shell: bash
run: echo "FILENAME=build/${{ steps.basefn.outputs.FILENAME }}.zip" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: "Set up JDK 17.0.2"
uses: actions/setup-java@v3
with:
java-version: '17.0.2'
distribution: 'temurin'
- name: "Validate Gradle wrapper"
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: "Create zip with Gradle"
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: jlinkZip
- name: "Rename zip file"
run: cp build/rcv.zip ${{ steps.fn.outputs.FILENAME }}
- name: "Generate SHA512 for Linux"
if: runner.os == 'Linux'
run: sha512sum ${{ steps.fn.outputs.FILENAME }} > ${{ steps.fn.outputs.FILENAME }}.sha512
- name: "Generate SHA512 for Windows"
if: runner.os == 'Windows'
shell: bash
run: certutil -hashfile ${{ steps.fn.outputs.FILENAME }} SHA512 >> ${{ steps.fn.outputs.FILENAME }}.sha512
- name: "Generate SHA512 for OSX"
if: runner.os == 'macOS'
run: openssl dgst -sha512 > ${{ steps.fn.outputs.FILENAME }}.sha512
- name: "Create caches filename"
id: cachefn
shell: bash
run: |
echo "FILENAME=${{ steps.basefn.outputs.FILENAME }}.cache.zip" >> $GITHUB_OUTPUT
- name: "Generate SHA1 and SHA256 for each maven dependency"
shell: bash
run: ./.github/workflows/generate-dependency-hashes.sh ${{ runner.os }} >> ~/.gradle/caches/checksums.csv
- name: "Create dependency zip"
uses: ./.github/actions/zip
with:
# Build, then remove all non-essential files
command: ./gradlew build -xtest && ./gradlew --stop && ls ~/.gradle/caches/* && for i in $(find ~/.gradle/caches -name gc.properties); do rm $i; done
input: "~/.gradle/caches"
zipFilename: ${{steps.cachefn.outputs.FILENAME}}
- name: "Generate SHA512 for plugins cache"
shell: bash
run: ./.github/workflows/sha.sh ${{steps.cachefn.outputs.FILENAME}} ${{ runner.os }} 512
- uses: actions/upload-artifact@v3
with:
name: Package
if-no-files-found: error
path: |
${{ github.workspace }}/${{ steps.fn.outputs.FILENAME }}
${{ github.workspace }}/${{ steps.fn.outputs.FILENAME }}.sha512
${{ github.workspace }}/${{steps.cachefn.outputs.FILENAME}}
${{ github.workspace }}/${{steps.cachefn.outputs.FILENAME}}.sha512
retention-days: 90
- name: "Upload binaries to release"
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name }} == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/${{ steps.fn.outputs.FILENAME }}*
tag: ${{ github.ref_name }}
overwrite: true
file_glob: true