Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Migrate CI from Travis and AppVeyor to Github actions #5125

Open
wants to merge 67 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b6578c3
Add pr github action
jeffsmale90 Dec 6, 2022
3055f95
Narrow matrix to specific node target
jeffsmale90 Dec 6, 2022
a4c4e47
Use setup git credentials
jeffsmale90 Dec 6, 2022
b95ec8c
Remove unnecessary exclusion of node 18 on ubuntu 18.04
jeffsmale90 Dec 6, 2022
be0635e
Add release workflow (triggered on pr)
jeffsmale90 Dec 7, 2022
2d813fc
Fix windows release build, fix artifacts uploader
jeffsmale90 Dec 7, 2022
62ea826
Change artifact path
jeffsmale90 Dec 7, 2022
39aa4ac
Skip windows, cos it does not work
jeffsmale90 Dec 7, 2022
b0c78ee
Try to fix the artifacts
jeffsmale90 Dec 7, 2022
d109d99
Change os based switch to be less specific
jeffsmale90 Dec 8, 2022
0037b4e
Re-enable windows build, but remove certificate. Need to re-add the c…
jeffsmale90 Dec 12, 2022
a7b3cdc
Add --publish argument to build scripts causing electron builder to a…
jeffsmale90 Dec 21, 2022
e97842d
Fix windows10 appx signing
jeffsmale90 Jan 24, 2023
dc3f0c1
Remove old signing certs
jeffsmale90 Jan 24, 2023
c4841a2
Add build-mac.sh
jeffsmale90 Jan 26, 2023
a4399be
update nvmrc
davidmurdoch Aug 29, 2023
b8c4391
2.7.2
davidmurdoch Aug 29, 2023
aed18f3
package lock fixes and such
davidmurdoch Aug 29, 2023
2522b34
more patches
davidmurdoch Aug 29, 2023
9290c11
fix test
davidmurdoch Aug 29, 2023
9b47d0c
try windows
davidmurdoch Aug 29, 2023
94f7d38
try this
davidmurdoch Aug 29, 2023
f2c0a72
this time?
davidmurdoch Aug 29, 2023
f741774
this time?
davidmurdoch Aug 29, 2023
b162b5e
powersheeellll
davidmurdoch Aug 29, 2023
eba9a8b
aaahhhh
davidmurdoch Aug 29, 2023
198b0a8
add ubuntu
davidmurdoch Aug 29, 2023
a8bf19e
enable publish for PR
davidmurdoch Aug 30, 2023
8e976cb
release via signed
davidmurdoch Aug 30, 2023
6e28983
ugh
davidmurdoch Aug 30, 2023
63f5997
prolly won't work
davidmurdoch Aug 30, 2023
e40d0df
sdfsadf
davidmurdoch Aug 30, 2023
e0906db
silly me
davidmurdoch Aug 30, 2023
428dbdd
ugh who knows
davidmurdoch Aug 31, 2023
85959d3
try updating truffle version to match ganache version
davidmurdoch Aug 31, 2023
bab9851
slkjdfhsaf
davidmurdoch Aug 31, 2023
ba86366
sigh
davidmurdoch Sep 1, 2023
3949e08
smaller
davidmurdoch Sep 1, 2023
68c40c5
enmable DEBUG
davidmurdoch Sep 1, 2023
c1d9339
add helpful error details
davidmurdoch Sep 1, 2023
f4b8018
test again
davidmurdoch Sep 1, 2023
a327d37
and this one
davidmurdoch Sep 1, 2023
11d6c4e
maybe this time
davidmurdoch Sep 1, 2023
79321fe
always something
davidmurdoch Sep 1, 2023
301b253
try the newer built-in notarization
davidmurdoch Sep 2, 2023
9be2c7f
remove `electron` from static/node
davidmurdoch Sep 5, 2023
2d509e9
maybe?
davidmurdoch Sep 5, 2023
873034b
temp: ignore static's node modules
davidmurdoch Sep 5, 2023
57e76c2
.
davidmurdoch Sep 5, 2023
981826e
the previous commit worked, is filecoin the problem?
davidmurdoch Sep 5, 2023
a8b8e9c
last one didn't work, remove ganache
davidmurdoch Sep 6, 2023
6a4a287
removing ganache didn't work, let's do this the other way. introduce …
davidmurdoch Sep 6, 2023
0fcb1e7
last one worked, so let's add a package
davidmurdoch Sep 6, 2023
5568106
last commit failed, remove @truffle/decoder and test with the rest
davidmurdoch Sep 6, 2023
990affe
add static/node to the `files` property of electron-build `build`
davidmurdoch Sep 6, 2023
2b52c16
this one
davidmurdoch Sep 6, 2023
52672f6
last one failed, attempt again
davidmurdoch Sep 7, 2023
8d8985c
maybe?
davidmurdoch Sep 7, 2023
6c75af6
sigh
davidmurdoch Sep 7, 2023
d409f71
last one didn't work. try removing all truffle and ganache
davidmurdoch Sep 7, 2023
03145ef
remove the web3 things
davidmurdoch Sep 8, 2023
306c540
last one worked, add web3-eth-abi
davidmurdoch Sep 8, 2023
c74c27c
what if this works?
davidmurdoch Oct 3, 2023
b0df0e0
only on mac
davidmurdoch Oct 3, 2023
e04f901
add deps back in
davidmurdoch Oct 3, 2023
8412f8d
remove fsevents
davidmurdoch Oct 3, 2023
c7865be
remove build-mac script since CI can do it now
davidmurdoch Oct 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Pull Requests

on: [pull_request]

jobs:
build:
strategy:
fail-fast: false
matrix:
node: [18.16.1]
os: [windows-2019, ubuntu-20.04, macos-11]

runs-on: ${{ matrix.os }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Add msbuild to PATH
# we need msbuild tools for the `bcrypto` module
if: startsWith(matrix.os, 'windows-')
uses: microsoft/[email protected]
- uses: de-vri-es/setup-git-credentials@v2
with:
credentials: ${{secrets.PAT}}
- run: npm ci
- run: npm run test
env:
FORCE_COLOR: 1
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release

# this should only run on release, but I'm triggering on pull_request so that I can test it
on: [pull_request]

jobs:
build:
strategy:
fail-fast: false
matrix:
node: [18.16.1]
os: [windows-2019, ubuntu-20.04, macos-12]

runs-on: ${{ matrix.os }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Downgrade npm to 8.16.0 # see https://github.com/electron-userland/electron-builder/issues/7755#issuecomment-1744147677
if: startsWith(matrix.os, 'macos-')
run: npm install -g [email protected]
- name: Add msbuild to PATH
# we need msbuild tools for the `bcrypto` module
if: startsWith(matrix.os, 'windows-')
uses: microsoft/[email protected]
- uses: de-vri-es/setup-git-credentials@v2
with:
credentials: ${{secrets.PAT}}
- if: startsWith(matrix.os, 'windows-')
run: |
$bytes = [Convert]::FromBase64String('${{ secrets.WINDOWS_CODE_SIGNING_PFX_BASE_64 }}');
Add-Content -Path '.\cert.pfx' -Value $bytes -AsByteStream;
Import-PfxCertificate -Password (ConvertTo-SecureString '${{ secrets.WINDOWS_CODE_SIGNING_PFX_PASSWORD }}' -AsPlainText -Force) -FilePath .\cert.pfx -CertStoreLocation Cert:\CurrentUser\My > $null;
- run: npm ci
env:
FORCE_COLOR: 1
- name: Build for Linux
if: startsWith(matrix.os, 'ubuntu-')
run: npm run build-linux
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
PUBLISH_FOR_PULL_REQUEST: true
- name: Build for Windows
if: startsWith(matrix.os, 'windows-')
run: npm run build-windows;
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CSC_FOR_PULL_REQUEST: true
PUBLISH_FOR_PULL_REQUEST: true
- name: Build for Mac
if: startsWith(matrix.os, 'macos-')
run: |
echo "Configuring keychain..."
export CERT=osx.p12
export NOTARIZE=true
base64 -d <<< "${{ secrets.APPLE_CERTIFICATE_P12_BASE64 }}" > $CERT
export CSC_KEYCHAIN=build.keychain
export KEYCHAIN_PASS=$RANDOM.$RANDOM.$RANDOM
security create-keychain -p $KEYCHAIN_PASS $CSC_KEYCHAIN
security default-keychain -s $CSC_KEYCHAIN
security unlock-keychain -p $KEYCHAIN_PASS $CSC_KEYCHAIN
security import $CERT -k $CSC_KEYCHAIN -P "${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}" -T /usr/bin/codesign
security set-keychain-settings $CSC_KEYCHAIN
echo "Setting key partition list"
security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k $KEYCHAIN_PASS $CSC_KEYCHAIN >/dev/null 2>&1
export DEBUG=electron-notarize:*
npm run build-mac
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
PUBLISH_FOR_PULL_REQUEST: true
CSC_FOR_PULL_REQUEST: true
APPLE_ID: ${{ secrets.APPLEID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLEIDPASSWORD }}
- uses: actions/upload-artifact@v3
with:
name: Release
path: |
dist/*.AppImage
dist/*.dmg
dist/*.blockmap
dist/*.zip
dist/*.appx
dist/*.yml
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
certs/cert.pfx
dist
node_modules
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.21.1
18.16.1
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Requirements:
To get started:

0. Clone this repo
0. Run `npm install`
0. Run `npm run dev`
1. Run `npm install`
2. Run `npm run dev`

If using Windows, you may need [windows-build-tools](https://www.npmjs.com/package/windows-build-tools) installed first.

Expand All @@ -40,15 +40,15 @@ Each platform has an associated `npm run` configuration to help you build on eac

Building on Windows will create a `.appx` file for use with the Windows Store.

Before building, create the `./certs` directory with the following files:
Before building, create the following files:

* `./certs/cert.pfx` - Note a `.pfx` file is identical to a `.p12`. (Just change the extension if you've been given a `.p12`.)
- `./cert.pfx` - Note a `.pfx` file is identical to a `.p12`. (Just change the extension if you've been given a `.p12`.)

In order to build on Windows, you must first ensure you have the [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) installed. If you have errors during the build process, ensure the package.json file's `windowsStoreConfig.windowsKit` points to your Windows 10 SDK directory. The one specified in the package.json file currently is what worked at the time this process was figured out; it may need to be updated periodically.

Because Windows requires a certificate to build the package -- and that certificate requires a password -- you'll need to run the following command instead of `npm run make`:

In order to successfully sign the appx bundle on Windows 10, an alternative `signtool.exe` to the binary bundled with electron-builder may need to be used. See https://github.com/electron-userland/electron-builder/pull/6817.
In order to successfully sign the appx bundle on Windows 10, an alternative `signtool.exe` to the binary bundled with electron-builder may need to be used. See https://github.com/electron-userland/electron-builder/pull/6817.

Install Windows SDK 18362 from https://developer.microsoft.com/en-us/windows/downloads/sdk-archive, and set the signtool path for electron-builder as follows:

Expand Down Expand Up @@ -96,10 +96,10 @@ Asset generation generally only needs to happen once, or whenever the app's logo

Two tools were used:

* [electron-icon-maker](https://www.npmjs.com/package/electron-icon-maker)
* [svg2uwptiles](https://www.npmjs.com/package/svg2uwptiles)
- [electron-icon-maker](https://www.npmjs.com/package/electron-icon-maker)
- [svg2uwptiles](https://www.npmjs.com/package/svg2uwptiles)

`electron-icon-maker` generates assets for all platforms when using Electron's `squirrel` package, and these assets live in `./static/icons`. `svg2uwptiles` generates all assets needed for the Windows appx build, and those assets live in `./build/appx`. These locations *can* be changed in the future, but make sure to change the associated configuration pointing to these assets.
`electron-icon-maker` generates assets for all platforms when using Electron's `squirrel` package, and these assets live in `./static/icons`. `svg2uwptiles` generates all assets needed for the Windows appx build, and those assets live in `./build/appx`. These locations _can_ be changed in the future, but make sure to change the associated configuration pointing to these assets.

Note from the author: I found managing these assets manually -- especially the appx assets -- was a pain. If possible, try not to edit the assets themselves and use one of the generators above.

Expand All @@ -115,7 +115,7 @@ When "extras" change they should be uploaded to a new release, and a correspondi

Below is a `.vscode/launch.json` configuration that will attach to both the **main** and **renderer** processes. You only need to run the **Launch Ganache UI** configuration; the renderer attach configuration will run automatically.

``` jsonc
```jsonc
{
"version": "0.2.0",
"configurations": [
Expand Down Expand Up @@ -148,7 +148,6 @@ Below is a `.vscode/launch.json` configuration that will attach to both the **ma
}
```


### By Truffle

Ganache is part of the Truffle suite of tools. [Find out more!](https://trufflesuite.com)
Binary file removed certs/cert.pfx.enc
Binary file not shown.
Binary file removed certs/osx.p12.enc
Binary file not shown.
Loading