From 01ee292d10517edba7299af9d81e7b83e03ab5c7 Mon Sep 17 00:00:00 2001 From: CakeLancelot Date: Tue, 2 Apr 2024 05:05:47 -0500 Subject: [PATCH] Introduce automatic artifact building and publishing --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2b47640 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 }} + diff --git a/package.json b/package.json index 9633a1a..3c47188 100644 --- a/package.json +++ b/package.json @@ -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",