-
Notifications
You must be signed in to change notification settings - Fork 570
110 lines (103 loc) · 4.96 KB
/
build-release-binaries.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
99
100
101
102
103
104
105
106
107
108
109
110
name: Build local wallet
permissions:
contents: write
on:
push:
tags:
- "*.*.*"
# branches: [testaction]
jobs:
build:
runs-on: macOS-latest
strategy:
matrix:
node-version: [16.13.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
#- run: brew install jq
#- run: echo "PackageVersion=$(cat package.json | jq '.version' | sed 's/\"//g')" >> $GITHUB_ENV
#- name: Update package.json
# run: |
# sed -i -e "s/${{ env.PackageVersion }}/${{ github.ref_name }}/g" package.json
- run: yarn install --network-concurrency 1 --frozen-lockfile
- name: Build package
run: npm run prepackage
- name: Build dmg
run: ./node_modules/.bin/electron-builder -p never --mac dmg
- name: Build deb
run: ./node_modules/.bin/electron-builder -p never --linux deb
- name: Build exe
run: ./node_modules/.bin/electron-builder -p never --windows
- name: Install coreutils for macOS hash
run: brew install coreutils
- name: Calc hash
id: calc_hash
run: |
echo "dmghash=$(sha256sum build/binaries/*.dmg|cut -c-64)" >> $GITHUB_OUTPUT
echo "debhash=$(sha256sum build/binaries/*.deb|cut -c-64)" >> $GITHUB_OUTPUT
echo "exehash=$(sha256sum build/binaries/*.exe|cut -c-64)" >> $GITHUB_OUTPUT
- name: Create Body
id: create_body
uses: bitshares/generate_release_notes@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
categories: |
[{
"title": "New features",
"labels": ["feature", "enhancement"]
}, {
"title": "Bug fixes and improvements",
"labels": ["bug", "bugfix"]
}]
template: |
Release Notes
_________________________________
$CHANGES
Binaries for download
--------
| Platform | SHA256 Checksum |
|---|---|
|[Microsoft Windows](https://github.com/bitshares/bitshares-ui/releases/download/${{ github.ref_name }}/BitShares_${{ github.ref_name }}.exe)|`${{steps.calc_hash.outputs.exehash}}`|
|[Mac](https://github.com/bitshares/bitshares-ui/releases/download/${{ github.ref_name }}/BitShares_${{ github.ref_name }}.dmg)|`${{steps.calc_hash.outputs.dmghash}}`|
|[Linux](https://github.com/bitshares/bitshares-ui/releases/download/${{ github.ref_name }}/BitShares_${{ github.ref_name }}.deb)|`${{steps.calc_hash.outputs.debhash}}`|
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: ${{ steps.create_body.outputs.body }}
draft: true
- name: Upload dmg
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/binaries/BitShares_${{ github.ref_name }}.dmg
asset_name: BitShares_${{ github.ref_name }}.dmg
asset_content_type: application/octet-stream
- name: Upload deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/binaries/BitShares_${{ github.ref_name }}.deb
asset_name: BitShares_${{ github.ref_name }}.deb
asset_content_type: application/x-deb
- name: Upload exe
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/binaries/BitShares_${{ github.ref_name }}.exe
asset_name: BitShares_${{ github.ref_name }}.exe
asset_content_type: application/octet-stream