-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters