Skip to content

Instantly share code, notes, and snippets.

@NoelDavies
Created December 1, 2019 14:03
Show Gist options
  • Save NoelDavies/858a89214fcb8cae575f7ef0219fa31b to your computer and use it in GitHub Desktop.
Save NoelDavies/858a89214fcb8cae575f7ef0219fa31b to your computer and use it in GitHub Desktop.
.github/workflow/app-build.yml
name: Electron Build
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-10.14, macos-latest, windows-latest, ubuntu-18.04]
steps:
- name: Context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: yarn install
run: |
yarn install
- name: Publish
run: |
yarn run build
- name: Cleanup artifacts (win)
if: contains(matrix.os, 'windows')
run: |
npx rimraf "build/!(*.exe)"
- name: Move extra build files into release archives
run: |
mv changelog.md build/changelog.md
mv release_readme.txt build/release.txt
mv release_upgrade.txt build/upgrade.txt
- name: Cleanup artifacts (nix)
run: |
npx rimraf "build/!(*.exe|*.deb|*.AppImage|*.dmg)"
if: contains(matrix.os, 'windows') == false
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}
path: build
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "build/**"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment