Skip to content

Commit

Permalink
feat(package): Rename package task to release, publish to GitHub
Browse files Browse the repository at this point in the history
with electron-builder
  • Loading branch information
ashchan committed Jul 26, 2019
1 parent 57933ff commit e3d473e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 41 deletions.
25 changes: 6 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ jobs:
- script: yarn test:e2e
name: Test

- job: Package
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- job: Release
condition: eq(variables['build.sourceBranch'], 'refs/heads/master')
pool:
vmImage: 'macos-10.14'
steps:
Expand All @@ -127,27 +127,14 @@ jobs:
displayName: 'Download Windows Signing Certificate'
inputs:
secureFile: Neuron_win.p12
- script: yarn package
name: Build
- script: yarn release
name: Release
displayName: 'Sign and Release'
env:
CSC_LINK: $(macSiginingCertificate.secureFilePath)
CSC_KEY_PASSWORD: $(macSiginingCertificatePassword)
WIN_CSC_LINK: $(winSiginingCertificate.secureFilePath)
WIN_CSC_KEY_PASSWORD: $(winSiginingCertificatePassword)
APPLE_ID: $(appleId)
APPLE_ID_PASSWORD: $(appleIdPassword)
- task: GitHubRelease@0
inputs:
gitHubConnection: nervos-bot
repositoryName: nervosnetwork/neuron
action: edit
tag: $(Build.SourceBranchName)
assets: |
$(Build.SourcesDirectory)/release/*.zip
$(Build.SourcesDirectory)/release/*.dmg
$(Build.SourcesDirectory)/release/*.exe
$(Build.SourcesDirectory)/release/*.deb
$(Build.SourcesDirectory)/release/*.AppImage
assetUploadMode: replace
isPreRelease: true
addChangeLog: false
GH_TOKEN: $(ghToken)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"clean": "lerna run --stream clean",
"prebuild": "yarn clean",
"build": "lerna run --stream build",
"package": "yarn build && ./scripts/copy-ui-files.sh && ./scripts/package.sh",
"release": "yarn build && ./scripts/copy-ui-files.sh && ./scripts/release.sh",
"test": "lerna run --parallel test",
"test:e2e": "yarn build && ./scripts/copy-ui-files.sh && lerna run --parallel test:e2e",
"lint": "lerna run --stream lint",
Expand Down
3 changes: 3 additions & 0 deletions packages/neuron-wallet/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ files:
- from: "../../node_modules/escape-string-regexp"
to: "node_modules/escape-string-regexp"

publish:
- github

nsis:
oneClick: false
createDesktopShortcut: always
Expand Down
21 changes: 0 additions & 21 deletions scripts/package.sh

This file was deleted.

21 changes: 21 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

function release() {
case $1 in
mac)
electron-builder --mac -p always
;;
win)
electron-builder --win --x64 -p always
;;
linux)
electron-builder --linux -p always
;;
*)
electron-builder -mwl -p always
;;
esac
}

cd packages/neuron-wallet/
release $1

0 comments on commit e3d473e

Please sign in to comment.