Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
ci: draft releases when merging to master (#1693)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Barnsley <[email protected]>
  • Loading branch information
faustbrian and alexbarnsley authored Feb 21, 2020
1 parent 4d9187b commit db72bb3
Show file tree
Hide file tree
Showing 9 changed files with 235 additions and 46 deletions.
171 changes: 171 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: Draft Release

on:
push:
branches:
- "master"

jobs:
# create-release:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v2

# - name: Determine the release version
# id: derive_release_version
# run: |
# RELEASE_VERSION=$(cat package.json | jq -r '.version')
# echo "::set-output name=version::${RELEASE_VERSION}"

# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ steps.derive_release_version.outputs.version }}
# release_name: Version ${{ steps.derive_release_version.outputs.version }}
# draft: true
# prerelease: false

publish-linux:
# needs: ["create-release"]

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-

- 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: 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 build/target/ark-desktop-wallet-linux-x86_64-2.8.1.AppImage

- name: Calculate Checksums for TAR
run: shasum -a 256 build/target/ark-desktop-wallet-linux-x64-2.8.1.tar.gz

- name: Calculate Checksums for DEB
run: shasum -a 256 build/target/ark-desktop-wallet-linux-amd64-2.8.1.deb

publish-macos:
# needs: ["create-release"]

runs-on: macos-latest

strategy:
matrix:
node-version: [12.x]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-

- 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 build/target/ark-desktop-wallet-mac-2.8.1.dmg

- name: Calculate Checksums for ZIP
run: shasum -a 256 build/target/ark-desktop-wallet-mac-2.8.1.zip

publish-windows:
# needs: ["create-release"]

runs-on: windows-latest

strategy:
matrix:
node-version: [12.x]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-

- 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 }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}

- name: Calculate Checksums for EXE
run: Get-FileHash build/target/ark-desktop-wallet-win-2.8.1.exe -Algorithm SHA256 | Format-List
shell: powershell
15 changes: 14 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
path: build/target/ark-desktop-wallet-linux-amd64-2.8.1.deb

build-macOS:
runs-on: macOS-latest
runs-on: macos-latest

strategy:
matrix:
Expand All @@ -129,8 +129,18 @@ jobs:
- 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
run: yarn build:mac
env:
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: Upload .zip
# uses: actions/upload-artifact@master
Expand Down Expand Up @@ -166,6 +176,9 @@ jobs:
- name: Build
run: yarn build:win
shell: cmd
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}

- name: Upload .exe
uses: actions/upload-artifact@v1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ yarn-error.log
__tests__/*/.coverage

plugins/*

!build/entitlements.mac.plist
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions build/entitlements.mac.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"electron-builder": "22.3.2",
"electron-debug": "^3.0.1",
"electron-devtools-installer": "^2.2.4",
"electron-notarize": "^0.2.1",
"eslint": "^6.1.0",
"eslint-config-standard": "^14.0.0",
"eslint-friendly-formatter": "^4.0.1",
Expand Down Expand Up @@ -192,6 +193,7 @@
"productName": "Ark Desktop Wallet",
"appId": "io.ark.desktop-wallet",
"artifactName": "${name}-${os}-${arch}-${version}.${ext}",
"afterSign": "scripts/notarize.js",
"npmRebuild": false,
"publish": {
"provider": "github",
Expand All @@ -216,7 +218,13 @@
"mac": {
"category": "public.app-category.finance",
"icon": "build/icons/icon.icns",
"hardenedRuntime": false
"hardenedRuntime": true,
"gatekeeperAssess": false,
"asarUnpack": [
"**/*.node"
],
"entitlements": "build/entitlements.mac.plist",
"entitlementsInherit": "build/entitlements.mac.plist"
},
"win": {
"target": "nsis",
Expand Down
18 changes: 18 additions & 0 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable no-return-await */
const { notarize } = require('electron-notarize')

exports.default = async function notarizing (context) {
const { electronPlatformName, appOutDir } = context
if (electronPlatformName !== 'darwin') {
return
}

const appName = context.packager.appInfo.productFilename

return await notarize({
appBundleId: 'io.ark.desktop-wallet',
appPath: `${appOutDir}/${appName}.app`,
appleApiKey: process.env.APPLE_API_KEY_ID,
appleApiIssuer: process.env.APPLE_API_KEY_ISSUER_ID
})
}
1 change: 1 addition & 0 deletions scripts/version-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ search=$(cat package.json | jq -r '.version')
replace="$npm_package_version"

sed -i '' "s/${search}/${replace}/g" .github/workflows/test.yml
sed -i '' "s/${search}/${replace}/g" .github/workflows/release.yml
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4647,6 +4647,14 @@ electron-log@^4.0.0:
resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.0.6.tgz#7d4244082a6f5ae3838f3fa4cd7271f8dd610bf1"
integrity sha512-inoIFKld98aRAp/l5IzLFx8Oc9sp+SKlTCrVgZKWK+qcI92rT574Ybgcah5dU8G3485vc7ClFIEfCf/IERyBJA==

electron-notarize@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/electron-notarize/-/electron-notarize-0.2.1.tgz#759e8006decae19134f82996ed910db26d9192cc"
integrity sha512-oZ6/NhKeXmEKNROiFmRNfytqu3cxqC95sjooG7kBXQVEUSQkZnbiAhxVh5jXngL881G197pbwpeVPJyM7Ikmxw==
dependencies:
debug "^4.1.1"
fs-extra "^8.1.0"

[email protected]:
version "22.3.2"
resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-22.3.2.tgz#d2e60caf7a9643fe57e501c20acaf32c737b1c50"
Expand Down

0 comments on commit db72bb3

Please sign in to comment.