Skip to content

Commit e3d473e

Browse files
committed
feat(package): Rename package task to release, publish to GitHub
with electron-builder
1 parent 57933ff commit e3d473e

File tree

5 files changed

+31
-41
lines changed

5 files changed

+31
-41
lines changed

azure-pipelines.yml

+6-19
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ jobs:
104104
- script: yarn test:e2e
105105
name: Test
106106

107-
- job: Package
108-
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
107+
- job: Release
108+
condition: eq(variables['build.sourceBranch'], 'refs/heads/master')
109109
pool:
110110
vmImage: 'macos-10.14'
111111
steps:
@@ -127,27 +127,14 @@ jobs:
127127
displayName: 'Download Windows Signing Certificate'
128128
inputs:
129129
secureFile: Neuron_win.p12
130-
- script: yarn package
131-
name: Build
130+
- script: yarn release
131+
name: Release
132+
displayName: 'Sign and Release'
132133
env:
133134
CSC_LINK: $(macSiginingCertificate.secureFilePath)
134135
CSC_KEY_PASSWORD: $(macSiginingCertificatePassword)
135136
WIN_CSC_LINK: $(winSiginingCertificate.secureFilePath)
136137
WIN_CSC_KEY_PASSWORD: $(winSiginingCertificatePassword)
137138
APPLE_ID: $(appleId)
138139
APPLE_ID_PASSWORD: $(appleIdPassword)
139-
- task: GitHubRelease@0
140-
inputs:
141-
gitHubConnection: nervos-bot
142-
repositoryName: nervosnetwork/neuron
143-
action: edit
144-
tag: $(Build.SourceBranchName)
145-
assets: |
146-
$(Build.SourcesDirectory)/release/*.zip
147-
$(Build.SourcesDirectory)/release/*.dmg
148-
$(Build.SourcesDirectory)/release/*.exe
149-
$(Build.SourcesDirectory)/release/*.deb
150-
$(Build.SourcesDirectory)/release/*.AppImage
151-
assetUploadMode: replace
152-
isPreRelease: true
153-
addChangeLog: false
140+
GH_TOKEN: $(ghToken)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"clean": "lerna run --stream clean",
3030
"prebuild": "yarn clean",
3131
"build": "lerna run --stream build",
32-
"package": "yarn build && ./scripts/copy-ui-files.sh && ./scripts/package.sh",
32+
"release": "yarn build && ./scripts/copy-ui-files.sh && ./scripts/release.sh",
3333
"test": "lerna run --parallel test",
3434
"test:e2e": "yarn build && ./scripts/copy-ui-files.sh && lerna run --parallel test:e2e",
3535
"lint": "lerna run --stream lint",

packages/neuron-wallet/electron-builder.yml

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ files:
2929
- from: "../../node_modules/escape-string-regexp"
3030
to: "node_modules/escape-string-regexp"
3131

32+
publish:
33+
- github
34+
3235
nsis:
3336
oneClick: false
3437
createDesktopShortcut: always

scripts/package.sh

-21
This file was deleted.

scripts/release.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
function release() {
4+
case $1 in
5+
mac)
6+
electron-builder --mac -p always
7+
;;
8+
win)
9+
electron-builder --win --x64 -p always
10+
;;
11+
linux)
12+
electron-builder --linux -p always
13+
;;
14+
*)
15+
electron-builder -mwl -p always
16+
;;
17+
esac
18+
}
19+
20+
cd packages/neuron-wallet/
21+
release $1

0 commit comments

Comments
 (0)