release: bump to v2.0.2 #27
Workflow file for this run
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 (and possibly publish) | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
tags: ['v*'] | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: 'Run the build with debug logging' | |
type: boolean | |
required: false | |
default: false | |
env: | |
NODE_VERSION: '22.x' | |
jobs: | |
build-mac-and-windows: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: [mac, windows] | |
fail-fast: false # Continue with other builds if one fails | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build ${{ matrix.target }} | |
run: npm run package:${{ matrix.target }} | |
- name: Upload ${{ matrix.target }} artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target }}-artifacts | |
path: | | |
${{ matrix.target == 'mac' && 'release/build/Deadbolt*.dmg' || 'release/build/*.exe' }} | |
if-no-files-found: error | |
build-linux-appimage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
npm ci | |
- name: Build AppImage | |
run: npm run package:linux-appimage | |
- name: Upload Linux artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-appimage-artifacts | |
path: release/build/*.AppImage | |
if-no-files-found: error | |
build-linux-flatpak: | |
runs-on: ubuntu-latest | |
container: | |
image: bilelmoussaoui/flatpak-github-actions:kde-6.5 | |
options: --privileged | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: -1 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Setup Flatpak | |
run: | | |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
flatpak install -y flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 org.electronjs.Electron2.BaseApp//23.08 | |
- name: Add Flatpak manifest | |
run: | | |
cat > org.alichtman.deadbolt.yml << 'EOF' | |
app-id: org.alichtman.deadbolt | |
runtime: org.freedesktop.Platform | |
runtime-version: '23.08' | |
sdk: org.freedesktop.Sdk | |
base: org.electronjs.Electron2.BaseApp | |
base-version: '23.08' | |
command: deadbolt | |
finish-args: | |
- --share=ipc | |
- --socket=x11 | |
- --socket=wayland | |
- --device=dri | |
- --filesystem=home | |
- --env=GDK_BACKEND=wayland,x11 | |
- --env=ELECTRON_OZONE_PLATFORM_HINT=auto | |
modules: | |
- name: deadbolt | |
buildsystem: simple | |
build-commands: | |
- mkdir -p /app/deadbolt | |
- cp -r * /app/deadbolt/ | |
- mkdir -p /app/bin | |
- ln -s /app/deadbolt/deadbolt /app/bin/deadbolt | |
sources: | |
- type: dir | |
path: . | |
EOF | |
- name: Build Flatpak package | |
run: npm run package:linux-flatpak | |
- name: Upload Flatpak bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
name: linux-flatpak-artifact | |
path: release/build/Deadbolt*.flatpak | |
create-release: | |
needs: [build-mac-and-windows, build-linux-appimage, build-linux-flatpak] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
- name: Create Release | |
uses: softprops/[email protected] | |
with: | |
draft: true | |
fail_on_unmatched_files: true | |
files: | | |
mac-artifacts/* | |
windows-artifacts/* | |
linux-appimage-artifacts/* | |
linux-flatpak-artifact/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |