1+ name : release
2+ on :
3+ push :
4+ branches :
5+ - master
6+ - feat/CI
7+ jobs :
8+ release :
9+ container : techknowlogick/xgo:latest
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Check out code
13+ uses : actions/checkout@v2
14+ - name : Parse the new version number check against current release
15+ run : |
16+ echo ::set-env name=VER::$(cat ./VERSION | tr -d "[:space:]")
17+ - name : Build the binary
18+ run : |
19+ make
20+ mv $(make target_name) ./artifacts/darknode_linux_amd64
21+ env GOOS=linux CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc-6 CXX=aarch64-linux-gnu-g++-6 GOARCH=arm64 make
22+ mv $(make target_name) ./artifacts/darknode_linux_arm
23+ env GOOS=darwin CGO_ENABLED=1 CC=o64-clang CXX=o64-clang++ GOARCH=amd64 make
24+ mv $(make target_name) ./artifacts/darknode_darwin_amd64
25+ - name : Create Release
26+ id : create_release
27+ uses : actions/create-release@v1
28+ env :
29+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30+ with :
31+ tag_name : ${{ env.VER }}
32+ release_name : ${{ env.VER }}
33+ draft : false
34+ prerelease : false
35+ - name : Upload binary for darwin/amd64
36+ uses : actions/upload-release-asset@v1
37+ env :
38+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39+ with :
40+ upload_url : ${{ steps.create_release.outputs.upload_url }}
41+ asset_path : ./artifacts/darknode_darwin_amd64
42+ asset_name : darknode_darwin_amd64
43+ asset_content_type : application/octet-stream
44+ - name : Upload binary for linux/amd64
45+ uses : actions/upload-release-asset@v1
46+ env :
47+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48+ with :
49+ upload_url : ${{ steps.create_release.outputs.upload_url }}
50+ asset_path : ./artifacts/darknode_linux_amd64
51+ asset_name : darknode_linux_amd64
52+ asset_content_type : application/octet-stream
53+ - name : Upload binary for linux/arm
54+ uses : actions/upload-release-asset@v1
55+ env :
56+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57+ with :
58+ upload_url : ${{ steps.create_release.outputs.upload_url }}
59+ asset_path : ./artifacts/darknode_linux_arm
60+ asset_name : darknode_linux_arm
61+ asset_content_type : application/octet-stream
62+ - name : Upload install script
63+ uses : actions/upload-release-asset@v1
64+ env :
65+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66+ with :
67+ upload_url : ${{ steps.create_release.outputs.upload_url }}
68+ asset_path : ./artifacts/install.sh
69+ asset_name : install.sh
70+ asset_content_type : text/x-sh; charset=utf-8
71+ - name : Upload update script
72+ uses : actions/upload-release-asset@v1
73+ env :
74+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75+ with :
76+ upload_url : ${{ steps.create_release.outputs.upload_url }}
77+ asset_path : ./artifacts/update.sh
78+ asset_name : update.sh
79+ asset_content_type : text/x-sh; charset=utf-8
80+ - name : Verify the installation process
81+ run : |
82+ curl https://www.github.com/renproject/darknode-cli/releases/latest/download/install.sh -sSfL | sh
83+ export PATH=$PATH:$HOME/.darknode/bin
84+ darknode --version
0 commit comments