Introduce automatic artifact building and publishing

This commit is contained in:
CakeLancelot 2024-04-02 05:05:47 -05:00
parent 2183106c73
commit 01ee292d10
2 changed files with 48 additions and 1 deletions

47
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Publish Build
on:
push:
branches: [ "main" ]
permissions:
contents: write
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Set up Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Pack into zip and create installer
run: npm run dist
- name: Upload Artifacts
uses: actions/upload-artifact@master
with:
path: dist
publish-release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@master
- name: Unzip artifact
run: unzip artifact.zip
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "*-ia32-win.zip,*.exe"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -7,7 +7,7 @@
"postinstall": "npx patch-package && npm explore electron-prebuilt -- npm run postinstall",
"start": "electron .",
"pack": "electron-builder --win --ia32 --dir",
"dist": "electron-builder --win --ia32",
"dist": "electron-builder --win --ia32 --publish=never",
"prettier": "npx prettier --write ."
},
"author": "OpenFusion Contributors",