Skip to content

build and release

build and release #28

Workflow file for this run

name: build and release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch: # Allows manual triggering
jobs:
macos:
strategy:
matrix:
os-version: ['12', '14']
include:
- os-version: '12'
arch: x86_64
- os-version: '14'
arch: aarch64
runs-on: macos-${{ matrix.os-version }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
DeskThingServer
- name: Install Node.js, NPM
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd DeskThingServer
npm ci
- name: Build/release Electron app
uses: paneron/action-electron-builder@v1.8.1
with:
github_token: ${{ secrets.github_token }}
package_manager: npm
package_root: ${{ github.workspace }}/DeskThingServer
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
name: deskthing-macos-${{ matrix.arch }}
path: ${{ github.workspace }}/DeskThingServer/dist/deskthing-*.dmg
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
name: Build ${{ matrix.os }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
DeskThingServer
- name: Install Node.js, NPM
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd DeskThingServer
npm ci
- name: Build/release Electron app
uses: paneron/action-electron-builder@v1.8.1
with:
github_token: ${{ secrets.github_token }}
package_manager: npm
package_root: ${{ github.workspace }}/DeskThingServer
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Upload windows binaries to artifacts
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: deskthing-${{matrix.os}}
path: ${{ github.workspace }}/DeskThingServer/dist/deskthing*.exe
- name: Upload linux binaries to artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: deskthing-${{matrix.os}}
path: ${{ github.workspace }}/DeskThingServer/dist/deskthing*
publish:
needs: [release, macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get Current Release
id: get_current_release
uses: joutvhu/get-release@v1
with:
latest: true
pattern: '^v.*'
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_current_release.outputs.tag_name }}
files: |
deskthing-macos-aarch64/*
deskthing-macos-x86_64/*
deskthing-ubuntu-latest/*
deskthing-windows-latest/*