mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
147 lines
4.1 KiB
YAML
147 lines
4.1 KiB
YAML
name: Build All & Release
|
|
on:
|
|
push:
|
|
branches: [ master, test/git-actions ]
|
|
tags:
|
|
- v*
|
|
|
|
|
|
jobs:
|
|
linux-bin-and-snap-release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v1
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: '**/node_modules'
|
|
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Install Yarn Packages
|
|
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
run: yarn install
|
|
|
|
- name: Lint
|
|
run: yarn lint
|
|
|
|
- name: Test Unit
|
|
run: yarn test
|
|
|
|
- name: Test E2E
|
|
run: yarn e2e
|
|
|
|
- name: Build Frontend & Electron
|
|
run: yarn build
|
|
|
|
- name: Build/Release Electron app
|
|
uses: samuelmeuli/action-electron-builder@v1
|
|
with:
|
|
build_script_name: empty
|
|
github_token: ${{ secrets.github_token }}
|
|
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
|
|
- name: Install Snapcraft
|
|
uses: samuelmeuli/action-snapcraft@v1
|
|
with:
|
|
# Log in to Snap Store
|
|
snapcraft_token: ${{ secrets.snapcraft_token }}
|
|
|
|
# Release to edge if no tag and to candidate if tag
|
|
- run: snapcraft push app-builds/superProductivity*.snap --release edge
|
|
if: false == startsWith(github.ref, 'refs/tags/v')
|
|
- run: snapcraft push app-builds/superProductivity*.snap --release candidate
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
|
|
mac-bin:
|
|
runs-on: macos-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
steps:
|
|
- name: Echo is Release
|
|
run: echo "IS_RELEASE $IS_RELEASE, ${{ startsWith(github.ref, 'refs/tags/v') }}"
|
|
env:
|
|
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v1
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: '**/node_modules'
|
|
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Install Yarn Packages
|
|
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
run: yarn install
|
|
|
|
- run: 'echo "$PROVISION_PROFILE" | base64 --decode > embedded.provisionprofile'
|
|
shell: bash
|
|
env:
|
|
PROVISION_PROFILE: ${{secrets.dl_provision_profile}}
|
|
|
|
- name: Prepare for app notarization
|
|
# Import Apple API key for app notarization on macOS
|
|
run: |
|
|
mkdir -p ~/private_keys/
|
|
echo '${{ secrets.mac_api_key }}' > ~/private_keys/AuthKey_${{ secrets.mac_api_key_id }}.p8
|
|
|
|
- name: Lint
|
|
run: yarn lint
|
|
|
|
- name: Test Unit
|
|
run: yarn test
|
|
|
|
- name: Test E2E
|
|
run: yarn e2e
|
|
|
|
- name: Build Frontend & Electron
|
|
run: yarn build
|
|
|
|
- name: Build/Release Electron app
|
|
uses: samuelmeuli/action-electron-builder@v1
|
|
with:
|
|
build_script_name: empty
|
|
github_token: ${{ secrets.github_token }}
|
|
mac_certs: ${{ secrets.mac_certs }}
|
|
mac_certs_password: ${{ secrets.mac_certs_password }}
|
|
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
env:
|
|
# macOS notarization API key
|
|
API_KEY_ID: ${{ secrets.mac_api_key_id }}
|
|
API_KEY_ISSUER_ID: ${{ secrets.mac_api_key_issuer_id }}
|
|
|
|
windows-bin:
|
|
runs-on: windows-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v1
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: '**/node_modules'
|
|
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Install Yarn Packages
|
|
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
run: yarn install
|
|
|
|
- name: Lint
|
|
run: yarn lint
|
|
|
|
- name: Test Unit
|
|
run: yarn test
|
|
|
|
- name: Build Frontend & Electron
|
|
run: yarn build
|
|
|
|
- name: Build/Release Electron app
|
|
uses: samuelmeuli/action-electron-builder@v1
|
|
with:
|
|
build_script_name: empty
|
|
github_token: ${{ secrets.github_token }}
|
|
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
|