armcord/.github/workflows/stable.yml
Aiden 10b7e638de
Updates and Linting (#578)
* Updates and Linting

* fix lint task

* [ImgBot] Optimize images

*Total -- 404.98kb -> 304.38kb (24.84%)

/assets/screenshot-1920x1080.png -- 205.00kb -> 123.21kb (39.9%)
/build/appx/Square150x150Logo.png -- 9.63kb -> 7.71kb (20%)
/assets/ac_icon.png -- 40.15kb -> 34.98kb (12.88%)
/assets/StoreLogo.png -- 40.15kb -> 34.98kb (12.88%)
/assets/Square150x150Logo.png -- 7.24kb -> 6.53kb (9.83%)
/assets/ac_icon_transparent.png -- 45.54kb -> 42.00kb (7.76%)
/assets/ac_plug_colored.png -- 17.98kb -> 16.72kb (7%)
/assets/ac_black_plug.png -- 8.49kb -> 8.06kb (5.06%)
/assets/ac_black_plug_hollow.png -- 10.30kb -> 9.95kb (3.4%)
/build/appx/Square44x44Logo.png -- 1.69kb -> 1.64kb (2.89%)
/assets/Square44x44Logo.png -- 1.90kb -> 1.85kb (2.83%)
/assets/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%)
/build/appx/Wide310x150Logo.png -- 4.21kb -> 4.17kb (0.97%)
/assets/ac_white_plug.png -- 8.49kb -> 8.42kb (0.83%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>

* Asyncification!!!
Check `REVIEW` comments

* More async for `src/discord`

* update packages to latest minor version

* Void some promises

* Add some types - 93 problems left!

* make DeepScan Happy

* DeepScan part 2

* I am the Constant

* preload must be `.mts`

* Migrate electron context menu official package

* fix bad preload on setup window

* fix minor import oversights

* fix modloader

* Stop main window from continuing during setup

* update packages, slow dependabot

* Remove paste override, it seems to work without now

* IPC typing

* Package updates & a few more typings

* fix linting errors in screenshare

* use pnpm in actions

* fix dev releaser?

* update node build, fix dev one more time

* release action is broke

* Fix Release

* update actions

* actions are so finicky

* remove delete-tag-and-release

* add github token env

* Hopefully this fixes the release workflow

* [debug]

* this should actually fix it

* Fix typo in dev action

* put everything in a dir and then get it

* use a different releaser

* correct release file location

* action places it in a folder named x.zip, recurse into that and grab the actual files

* Cleanup actions a bit

* release is dependent on mac build

* remove mac build

* split linux arm and x86

* rely on linux arm

* remove deprecated action

* attempt to fix weird recursive zip

* fix env

* use pnpm in actions

fix dev releaser?

update node build, fix dev one more time

release action is broke

Fix Release

update actions

actions are so finicky

remove delete-tag-and-release

add github token env

Hopefully this fixes the release workflow

[debug]

this should actually fix it

Fix typo in dev action

put everything in a dir and then get it

use a different releaser

correct release file location

action places it in a folder named x.zip, recurse into that and grab the actual files

Cleanup actions a bit

release is dependent on mac build

remove mac build

split linux arm and x86

rely on linux arm

remove deprecated action

attempt to fix weird recursive zip

fix env

* don't globally install pnpm packages (I don't think the cache checks global)

* Type the armcord window

* Finalize typings

* fix deepscan issues

* fix screenshare preload

* fix app quitting

---------

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
Co-authored-by: smartfrigde <37928912+smartfrigde@users.noreply.github.com>
2024-06-14 14:57:34 +02:00

238 lines
7.8 KiB
YAML

name: Release build
on:
push:
branches:
- stable
env:
FORCE_COLOR: true
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install Node dependencies
run: pnpm i -g cargo-cp-artifact electron-builder && pnpm i
- name: Build
run: pnpm run build && electron-builder --linux && electron-builder --arm64 --linux && electron-builder --armv7l --linux
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List all files in the dist directory
run: ls -l dist
- name: Delete unpacked builds
run: rm -rf dist/linux-unpacked && rm -rf dist/linux-arm64-unpacked && rm -rf dist/linux-armv7l-unpacked
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ArmCordLinux
path: dist/
build-mac:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install Node dependencies
run: pnpm i -g cargo-cp-artifact electron-builder && pnpm i
- name: Build
run: pnpm run build && electron-builder --macos --x64 --arm64
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List all files in the dist directory
run: ls -l dist
- name: Delete unpacked builds
run: rm -rf dist/macos-unpacked
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ArmCordMac
path: dist/
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install Node dependencies
run: pnpm i -g cargo-cp-artifact electron-builder && pnpm i
- name: Build
run: pnpm run build && electron-builder --windows
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete unpacked builds
run: Remove-Item -LiteralPath ".\dist\win-unpacked" -Force -Recurse
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ArmCordWindows
path: dist/
build-windowsOnARM:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Set architecture
run: set npm_config_arch=arm64
- name: Install Node dependencies
run: pnpm install -g cargo-cp-artifact electron-builder && pnpm install
- name: Build
run: pnpm run build && electron-builder --windows --arm64
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete unpacked builds
run: Remove-Item -LiteralPath ".\dist\win-arm64-unpacked" -Force -Recurse
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ArmCordWindowsArm64
path: dist/
release:
runs-on: ubuntu-latest
needs: [build-linux, build-mac, build-windows, build-windowsOnARM]
steps:
- uses: actions/download-artifact@v4
with:
name: ArmCordMac
path: macos
- uses: actions/download-artifact@v4
with:
name: ArmCordWindows
path: windows
- uses: actions/download-artifact@v4
with:
name: ArmCordWindowsArm64
path: windows
- uses: actions/download-artifact@v4
with:
name: ArmCordLinux
path: linux
- name: ls
run: ls
- name: Delete unwanted directories
run: rm -rf {linux,macos,windows}/*/
rm -rf {linux,macos,windows}/.icon*
rm -rf {linux,macos,windows}/builder-debug.yml
- name: ls dirs
run: ls linux && ls macos && ls windows
- name: Get some values needed for the release
id: vars
shell: bash
run: |
echo "::set-output name=releaseTag::$(git describe --tags --abbrev=0)"
- name: Create Release
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
console.log('environment', process.versions);
const fs = require('fs').promises;
const { repo: { owner, repo }, sha } = context;
console.log({ owner, repo, sha });
const release = await github.repos.createRelease({
owner, repo,
tag_name: process.env.releaseTag,
draft: true,
target_commitish: sha
});
console.log('created release', { release });
for (let file of await fs.readdir('linux')) {
// do whatever filtering you want here, I'm just uploading all the files
console.log('uploading', file);
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: release.data.id,
name: file,
data: await fs.readFile(`./linux/${file}`)
});
}
for (let file of await fs.readdir('windows')) {
// do whatever filtering you want here, I'm just uploading all the files
console.log('uploading', file);
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: release.data.id,
name: file,
data: await fs.readFile(`./windows/${file}`)
});
}
for (let file of await fs.readdir('macos')) {
// do whatever filtering you want here, I'm just uploading all the files
console.log('uploading', file);
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: release.data.id,
name: file,
data: await fs.readFile(`./macos/${file}`)
});
}
env:
releaseTag: ${{ steps.vars.outputs.releaseTag }}