Skip to content

Commit

Permalink
add electron github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aarron-lee committed Jan 8, 2024
1 parent 87c08f5 commit ca44333
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/electron-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release

permissions:
contents: write

on:
workflow_dispatch:
push:
branches:
- "main"
tags:
- "v*.*.*"

jobs:
build_plugin:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: set git global safe directory
run: |
pacman -Syu git npm --noconfirm
git config --global --add safe.directory $(realpath .)
- uses: actions/checkout@v3

- name: build AppImage
run: |
npm install
npm run electron-build
cd electron
npm install
npm run build
chmod +x dist/hhd-ui.AppImage
continue-on-error: true

- name: show files
run: |
ls dist/hhd-ui.AppImage
- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: hhd-ui-electron
path: dist/hhd-ui.AppImage

publish:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: build_plugin
steps:
- run: mkdir /tmp/artifacts

- name: download artifact
uses: actions/download-artifact@v3
with:
path: /tmp/artifacts

- run: ls -R /tmp/artifacts

- name: publish to github release
uses: softprops/action-gh-release@v1
with:
files: /tmp/artifacts/hhd-ui/hhd-ui.AppImage
tag_name: ${{ github.ref_name }}
body: |
hhd-ui
draft: true
prerelease: contains(github.ref, 'pre')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build": {
"appId": "com.hhd-dev.hhd-ui",
"productName": "Handheld Daemon",
"artifactName": "hhd-ui.${ext}",
"linux": {
"target": "AppImage"
}
Expand Down

0 comments on commit ca44333

Please sign in to comment.