This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 190
171 lines (166 loc) · 8.36 KB
/
publish-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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Publish Release
on:
push:
branches:
- "master"
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create tag
uses: actions/github-script@v4
with:
github-token: ${{ github.token }}
script: |
const { data } = await github.request("https://api.github.com/repos/ArkEcosystem/desktop-wallet/releases/latest");
const { version } = require("./package.json");
github.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: version,
name: `Version ${version}`,
body: (await github.request(`https://ghlogs.basecode.sh/ArkEcosystem/desktop-wallet/${data.tag_name}/develop`)).data,
draft: true,
prerelease: false,
target_commitish: context.sha,
})
publish-linux:
needs: ["create-release"]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node modules
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Update System
run: sudo apt-get update
- name: Install snapcraft
run: sudo snap install snapcraft --classic
- name: Ledger
run: sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: Install
run: yarn global add node-gyp && yarn install --frozen-lockfile
- name: Re-build bcrypto
run: cd node_modules/bcrypto && npm install && cd ../../
- name: Build & Publish
run: yarn build:linux:publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate Checksums for AppImage
run: shasum -a 256 dist/target/ark-desktop-wallet-linux-x86_64-3.0.0.AppImage
- name: Calculate Checksums for TAR
run: shasum -a 256 dist/target/ark-desktop-wallet-linux-x64-3.0.0.tar.gz
- name: Calculate Checksums for DEB
run: shasum -a 256 dist/target/ark-desktop-wallet-linux-amd64-3.0.0.deb
- name: VirusTotal Scan for AppImage
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@dist/target/ark-desktop-wallet-linux-x86_64-3.0.0.AppImage' | jq -r .permalink
- name: VirusTotal Scan for TAR
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@dist/target/ark-desktop-wallet-linux-x64-3.0.0.tar.gz' | jq -r .permalink
- name: VirusTotal Scan for DEB
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@dist/target/ark-desktop-wallet-linux-amd64-3.0.0.deb' | jq -r .permalink
publish-macos:
needs: ["create-release"]
runs-on: macos-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node modules
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn global add node-gyp && yarn install --frozen-lockfile
- name: Prepare for app notarization
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.APPLE_API_KEY }}' > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
- name: Build & Publish
run: yarn build:mac:publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER_ID: ${{ secrets.APPLE_API_KEY_ISSUER_ID }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
- name: Calculate Checksums for DMG
run: shasum -a 256 dist/target/ark-desktop-wallet-mac-3.0.0.dmg
- name: Calculate Checksums for ZIP
run: shasum -a 256 dist/target/ark-desktop-wallet-mac-3.0.0.zip
- name: VirusTotal Scan for DMG
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@dist/target/ark-desktop-wallet-mac-3.0.0.dmg' | jq -r .permalink
- name: VirusTotal Scan for ZIP
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@dist/target/ark-desktop-wallet-mac-3.0.0.zip' | jq -r .permalink
publish-windows:
needs: ["create-release"]
runs-on: windows-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node modules
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn global add node-gyp && yarn install --frozen-lockfile
shell: cmd
- name: Build & Publish
run: yarn build:win:publish
shell: cmd
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate Checksums for EXE
run: Get-FileHash dist/target/ark-desktop-wallet-win-3.0.0.exe -Algorithm SHA256 | Format-List
shell: powershell