Skip to content

Commit

Permalink
Merge branch 'Legcord:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
CCIGAMES authored Oct 15, 2024
2 parents da36fb7 + 9dd689a commit dac0724
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 188 deletions.
21 changes: 0 additions & 21 deletions .github/actions/build-typescript/action.yaml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/dev-build.yml

This file was deleted.

126 changes: 126 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Package
on:
push:
branches:
- dev
- stable
jobs:
package:
continue-on-error: true
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{matrix.os}}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

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

- name: Add commit to version
if: github.ref_name == 'dev'
run: cat <<< $(jq --arg ver "$(jq -r '.version' package.json)-$(git rev-parse --short HEAD)" '.version = $ver' package.json) > package.json
shell: bash

- 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: Install SnapCraft
if: matrix.os == 'macos-latest'
uses: samuelmeuli/action-snapcraft@v2

- 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
env:
CSC_LINK: "https://legcord.app/NewSign.p12"
CSC_KEY_PASSWORD: ${{ secrets.MACOS_SIGN_PASS }}
APPLE_ID: ${{secrets.APPLE_ID}}
APPLE_APP_SPECIFIC_PASSWORD: ${{secrets.APPLE_ID_PASSWORD}}
APPLE_TEAM_ID: ${{secrets.APPLE_TEAM_ID}}

- name: Build Electron for Linux (Snap)
if: matrix.os == 'macos-latest'
run: pnpm electron-builder --x64 -l snap --publish always

- 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: Build Electron for Linux (RPM, DEB, AppImage & ZIP)
if: matrix.os == 'ubuntu-latest'
run: pnpm electron-builder --armv7l --arm64 --x64 -l rpm deb appimage 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
if: github.ref_name == 'dev'
uses: ncipollo/release-action@v1
with:
name: Rolling Dev Build
allowUpdates: true
removeArtifacts: true
prerelease: true
body: "Built against https://github.com/Legcord/Legcord/tree/dev on every commit. NOTE: tarballs do not update."
draft: false
tag: devbuild
artifacts: release-files/**/*

- name: Create release
if: github.ref_name == 'stable'
uses: ncipollo/release-action@v1
with:
name: Stable Release Draft
prerelease: false
tag: stable
draft: true
artifacts: release-files/**/*
78 changes: 0 additions & 78 deletions .github/workflows/stable-build.yml

This file was deleted.

8 changes: 0 additions & 8 deletions build/installer.nsh

This file was deleted.

19 changes: 11 additions & 8 deletions electron-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ export const config: Configuration = {
notarize: true,
extendInfo: {
NSMicrophoneUsageDescription: "Legcord requires access to the microphone to function properly.",
NSCameraUsageDescription: "legcord requires access to the camera to function properly.",
NSCameraUsageDescription: "Legcord requires access to the camera to function properly.",
"com.apple.security.device.audio-input": true,
"com.apple.security.device.camera": true,
},
},

linux: {
icon: "build/icon.icns",
target: ["AppImage", "deb", "rpm", "tar.gz"],
maintainer: "[email protected]",
category: "Network",
},

nsis: {
oneClick: false,
allowToChangeInstallationDirectory: false,
Expand All @@ -31,18 +38,14 @@ export const config: Configuration = {
showNameOnTiles: true,
},

linux: {
icon: "build/icon.icns",
target: ["AppImage", "deb", "rpm", "tar.gz"],
maintainer: "[email protected]",
category: "Network",
},

snap: {
environment: { ARRPC_NO_PROCESS_SCANNING: "true" },
allowNativeWayland: true,
executableArgs: ["--no-process-scanning"],
base: "core24",
publish: {
provider: "snapStore",
},
},

files: ["!*", "assets", "node-modules", "ts-out", "package.json", "license.txt"],
Expand Down

0 comments on commit dac0724

Please sign in to comment.