1
+ name : Release
2
+ on :
3
+ push :
4
+ tags :
5
+ - ' *'
6
+ permissions :
7
+ contents : write
8
+ packages : write
9
+ repository-projects : write
10
+
11
+ jobs :
12
+ build_javascore :
13
+ name : Build Javascore Contracts
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - name : Checkout code
17
+ uses : actions/checkout@v3
18
+ with :
19
+ submodules : true
20
+
21
+ - name : Build Javascore Contracts
22
+ run : |
23
+ ./gradlew clean build
24
+ ./gradlew optimizedJar
25
+ ./gradlew zipOutputOptimizedJars
26
+ - name : Upload Artifacts
27
+ uses : actions/upload-artifact@v3
28
+ with :
29
+ name : javascore-contracts
30
+ path : ./build/javascore-contracts.zip
31
+
32
+ release :
33
+ name : Release and Publish
34
+ runs-on : ubuntu-latest
35
+ needs :
36
+ - build_javascore
37
+ steps :
38
+ - name : Initialize variables
39
+ id : vars
40
+ run : |
41
+ echo «::set-output name=date::$(date +'%Y-%m-%d')»
42
+ echo «::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)»
43
+ - name : Download Javascore Artifacts
44
+ uses : actions/download-artifact@v2
45
+ with :
46
+ name : javascore-contracts
47
+ path : javascore-contracts
48
+
49
+ - name : Unzip Javascore Artifacts
50
+ run : unzip javascore-contracts/javascore-contracts.zip -d javascore-contracts && rm -rf javascore-contracts/javascore-contracts.zip
51
+
52
+ - name : Changelog
53
+ uses : scottbrenner/generate-changelog-action@master
54
+ id : Changelog
55
+ env :
56
+ REPO : ${{ github.repository }}
57
+
58
+ - name : Generate checksum
59
+ uses : jmgilman/actions-generate-checksum@v1
60
+ with :
61
+ patterns : |
62
+ javascore-contracts/*.jar
63
+ output : check256sums.txt
64
+
65
+ - name : Create Release
66
+ id : create_release
67
+ uses : softprops/action-gh-release@v1
68
+ if : startsWith(github.ref, 'refs/tags/')
69
+ with :
70
+ token : ${{ secrets.GITHUB_TOKEN }}
71
+ body : |
72
+ ${{ steps.Changelog.outputs.changelog }}
73
+ files : |
74
+ ./javascore-contracts/*.jar
75
+ check256sums.txt
0 commit comments