-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c6c818
commit 0c83703
Showing
3 changed files
with
139 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ name: Build/release | |
|
||
on: [push, pull_request] | ||
|
||
env: | ||
GH_TOKEN: ${{ SECRETS.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
release: | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -10,6 +13,13 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
include: | ||
- os: ubuntu-latest | ||
arch: x64 | ||
- os: ubuntu-latest | ||
arch: arm64 | ||
- os: ubuntu-latest | ||
arch: arm | ||
|
||
steps: | ||
- name: Check out Git repository | ||
|
@@ -20,25 +30,45 @@ jobs: | |
with: | ||
node-version: 20 | ||
|
||
- name: Install Snapcraft | ||
uses: samuelmeuli/action-snapcraft@v1 | ||
# Only install Snapcraft on Ubuntu | ||
if: startsWith(matrix.os, 'ubuntu') | ||
with: | ||
# Log in to Snap Store | ||
snapcraft_token: ${{ secrets.snapcraft_token }} | ||
- name: Build | ||
run: yarn --link-duplicates --pure-lockfile | ||
|
||
- name: Install libarchive-tools for pacman build # Related https://github.com/electron-userland/electron-builder/issues/4181 | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: sudo apt-get install libarchive-tools | ||
|
||
- name: Build/release Electron app | ||
uses: coparse-inc/[email protected] | ||
with: | ||
# GitHub token, automatically provided to the action | ||
# (No need to define this secret in the repo settings) | ||
github_token: ${{ secrets.github_token }} | ||
- name: Build for test only linux | ||
if: | | ||
github.ref != 'main' && | ||
startsWith(matrix.os, 'ubuntu') | ||
run: yarn dist:linux:${{ matrix.arch }} -- --publish never | ||
|
||
- name: Release linux | ||
if: | | ||
github.ref == 'main' && | ||
startsWith(matrix.os, 'ubuntu') | ||
run: yarn dist:linux:${{ matrix.arch }} -- --publish always | ||
|
||
- name: Build for test only macos | ||
if: | | ||
github.ref != 'main' && | ||
startsWith(matrix.os, 'macos') | ||
run: yarn dist:mac -- --publish never | ||
|
||
- name: Release macos | ||
if: | | ||
github.ref == 'main' && | ||
startsWith(matrix.os, 'macos') | ||
run: yarn dist:mac -- --publish always | ||
|
||
- name: Build for test only windows | ||
if: | | ||
github.ref != 'main' && | ||
startsWith(matrix.os, 'windows') | ||
run: yarn dist:windows -- --publish never | ||
|
||
# If the commit is tagged with a version (e.g. "v1.0.0"), | ||
# release the app after building | ||
release: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
- name: Release windows | ||
if: | | ||
github.ref == 'main' && | ||
startsWith(matrix.os, 'windows') | ||
run: yarn dist:windows -- --publish always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Build/release for Snap | ||
|
||
on: push | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
|
||
snap: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node.js, NPM and Yarn | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Build | ||
run: yarn --link-duplicates --pure-lockfile | ||
|
||
- name: Install Snapcraft | ||
uses: samuelmeuli/action-snapcraft@v2 | ||
|
||
- name: Build for test only | ||
if: github.ref != 'main' | ||
run: yarn dist:linux:snap --publish never | ||
|
||
- name: Release | ||
if: github.ref == 'main' | ||
run: yarn dist:linux:snap --publish always | ||
|
||
snap-armv7l: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node.js, NPM and Yarn | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Build | ||
run: yarn --link-duplicates --pure-lockfile | ||
|
||
- name: Install Snapcraft | ||
uses: samuelmeuli/action-snapcraft@v2 | ||
|
||
- name: Build for test only | ||
if: github.ref != 'main' | ||
run: yarn dist:linux:snap:armv7l --publish never | ||
|
||
- name: Release | ||
if: github.ref == 'main' | ||
run: yarn dist:linux:snap:armv7l --publish always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters