📦 add flatpak metainfo #43
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
name: Build/release | |
on: push | |
jobs: | |
release: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-20.04, windows-latest] | |
env: | |
ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron | |
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder | |
DEPLOY_RELEASE: ${{ github.repository == 'Doccrazy/stash-electron' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) }} | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Dependencies for Ubuntu | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
if: runner.os == 'Linux' | |
with: | |
packages: libssl-dev libkrb5-dev flatpak-builder | |
version: 1.0 | |
- name: Cache Flatpak | |
if: runner.os == 'Linux' | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local/share/flatpak | |
key: ${{ runner.os }}-flatpak-${{ hashFiles('package.json') }} | |
- name: Add Flatpak repo | |
if: runner.os == 'Linux' | |
run: flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
- name: Install Node.js, NPM and Yarn | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: yarn | |
- name: Cache Electron-Builder | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ github.workspace }}/.cache/electron | |
${{ github.workspace }}/.cache/electron-builder | |
key: ${{ runner.os }}-electron-builder-cache-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-electron-builder-cache- | |
- name: Install dependencies | |
run: yarn install | |
- name: Cache Nodegit build | |
id: cache-nodegit | |
if: runner.os == 'Linux' | |
uses: actions/cache@v3 | |
with: | |
path: .yarn/unplugged/nodegit-* | |
key: ${{ runner.os }}-${{ hashFiles('.yarn/unplugged/nodegit-*/node_modules/nodegit/package.json') }} | |
- name: Rebuild (Linux) | |
if: runner.os == 'Linux' && steps.cache-nodegit.outputs.cache-hit != 'true' | |
run: yarn rebuild | |
env: | |
BUILD_ONLY: '1' | |
NODEGIT_OPENSSL_STATIC_LINK: '1' | |
- name: Build/sign/release Electron macOS app | |
if: runner.os == 'macOS' | |
run: yarn package | |
env: | |
GH_TOKEN: ${{ github.ref == 'refs/heads/master' && secrets.RELEASE_REPO_TOKEN || secrets.github_token }} | |
CSC_LINK: ${{ secrets.CSC_LINK }} | |
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
NOTARIZE_APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }} | |
NOTARIZE_APPLE_ID_PASS: ${{ secrets.NOTARIZE_APPLE_ID_PASS }} | |
NOTARIZE_TEAM_ID: ${{ secrets.NOTARIZE_TEAM_ID }} | |
BUILD_SKIP_REBUILD: '1' | |
- name: Build/release Electron Linux app | |
if: runner.os == 'Linux' | |
run: yarn package | |
env: | |
GH_TOKEN: ${{ github.ref == 'refs/heads/master' && secrets.RELEASE_REPO_TOKEN || secrets.github_token }} | |
BUILD_SKIP_REBUILD: '1' | |
DEBUG: '@malept/flatpak-bundler' | |
- name: Build/release Electron Windows app | |
if: runner.os == 'Windows' | |
run: yarn package | |
env: | |
GH_TOKEN: ${{ github.ref == 'refs/heads/master' && secrets.RELEASE_REPO_TOKEN || secrets.github_token }} | |
BUILD_SKIP_REBUILD: '1' | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ runner.os }} Release Build | |
path: | | |
release/*.* | |
retention-days: 7 | |
- name: Delete older releases | |
id: delete-older-releases | |
if: ${{ github.repository == 'Doccrazy/stash-electron' && github.ref == 'refs/heads/master' && runner.os == 'Linux' }} | |
uses: dev-drprasad/delete-older-releases@v0.2.0 | |
with: | |
repo: Doccrazy/stash-electron-snapshots | |
keep_latest: 10 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_REPO_TOKEN }} |