Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KM8Oz/713f7a6b95169abc62efe69ea26319bb to your computer and use it in GitHub Desktop.
Save KM8Oz/713f7a6b95169abc62efe69ea26319bb to your computer and use it in GitHub Desktop.
name: Electron CD
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
include:
- os: macos-latest
TARGET: build-mac
ARTI: release/*.dmg
SET: export
- os: windows-latest
TARGET: build-win
ARTI: release/*.exe
SET: set
- os: ubuntu-latest
TARGET: build-linux
ARTI: release/*.AppImage
SET: set
steps:
- uses: actions/checkout@v1
- run: echo ${{ matrix.TARGET }}
- name: Context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: set gh_token
run: ${{matrix.SET}} GH_TOKEN=${{ secrets.TOKEN }}
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: yarn install
run: yarn install
- name: Publish
run: ${{matrix.SET}} CSC_IDENTITY_AUTO_DISCOVERY=false && yarn ${{matrix.TARGET}}
env:
GH_TOKEN: ${{ secrets.TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@v1
env:
GH_TOKEN: ${{ secrets.TOKEN }}
with:
name: ${{ matrix.os }}
path: release
if-no-files-found: warn # 'warn' or 'ignore'
- uses: deka0106/upload-to-dropbox@v2
with:
dropbox_access_token: ${{ secrets.DROPBOX_ACCESS_TOKEN }}
src: ${{matrix.ARTI}}
dest: v_${{ github.event.head_commit.message }}
multiple: true
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{matrix.ARTI}}
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
# `"build": `
# ----------------
# ```
# {
# "productName": "example-app",
# "appId": "com.example.app",
# "directories": {
# "buildResources": "assets",
# "output": "release"
# },
# "files": [
# "assets/**/*",
# "!node_modules",
# "src/main",
# "src/dist"
# ],
# "mac": {
# "identity": "null",
# "icon": "assets/icon.icns",
# "type": "distribution",
# "hardenedRuntime": true,
# "entitlements": "assets/entitlements.mac.plist",
# "entitlementsInherit": "assets/entitlements.mac.plist",
# "gatekeeperAssess": false
# },
# "win": {
# "icon": "assets/icon.ico",
# "publisherName":"----------------------",
# "target": [
# "nsis",
# "msi"
# ]
# },
# "dmg": {
# "contents": [{
# "x": 130,
# "y": 220
# },
# {
# "x": 410,
# "y": 220,
# "type": "link",
# "path": "/Applications"
# }
# ]
# },
# "linux": {
# "target": [
# "AppImage"
# ],
# "description": "----------------------",
# "category": "Development",
# "maintainer": "----------------------"
# },
# "extraResources": [
# "./assets/**"
# ],
# "publish": [{
# "provider": "github",
# "owner": "[USERNAME]",
# "repo": "[REPO]",
# "private": true
# }],
# "extends": null,
# "nsis": {
# "oneClick": false,
# "perMachine": false,
# "allowToChangeInstallationDirectory": true,
# "deleteAppDataOnUninstall": false
# }
# }
# ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment