Skip to content

Commit

Permalink
lobotomize actions
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeAspy committed Nov 5, 2024
1 parent 8b8aa91 commit 1989e68
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 1 deletion.
88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Package
on: push

jobs:
package:
continue-on-error: true
strategy:
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{matrix.os}}
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Prepare PNPM
uses: pnpm/action-setup@v4

- name: Prepare Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: pnpm

- name: Install dependencies
run: pnpm i

- name: Build TypeScript
run: pnpm build

- name: Load Electron cache
uses: actions/cache/restore@v4
with:
path: .cache
key: electron-zips.${{matrix.os}}

# Sadly, it makes more sense to separate builds per platform
- name: Build Electron for MacOS (DMG & ZIP)
if: matrix.os == 'macos-latest'
run: pnpm electron-builder --universal -m zip dmg

- name: Build Electron for Windows (NSIS, AppX, & ZIP)
if: matrix.os == 'windows-latest'
run: pnpm electron-builder --ia32 --arm64 --x64 -w nsis appx zip

- name: Save Electron Cache
uses: actions/cache/save@v4
with:
path: .cache
key: electron-zips.${{matrix.os}}

- name: Collect artifacts
run:
mkdir artifacts |
find dist/. -maxdepth 1 -type f -exec mv {} artifacts \;
shell: bash

- name: Upload artifactsstable
uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}-artifacts
path: artifacts/*

release:
runs-on: ubuntu-latest
needs:
- package
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release-files

- name: Create release
uses: ncipollo/release-action@v1
with:
name: Rolling Dev Build
allowUpdates: true
removeArtifacts: true
prerelease: true
body: "Built against https://github.com/Legcord/Legacy/tree/main on every commit. NOTE: tarballs do not update."
draft: false
tag: devbuild
artifacts: release-files/**/*
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@
"applicationId": "smartfrigde.Legcord"
}
},
"packageManager": "pnpm@9.12.2+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228"
"packageManager": "pnpm@10.0.0-alpha.0+sha512.856941ef22665d2f3e41c04e8d86ed757ef057fb2bc35011698bfa988ef5817cc1cdd28bb883e7f23f0568c75de5544d4750211d4276b9ba6d55369eb207a549"
}

0 comments on commit 1989e68

Please sign in to comment.