2022-06-02 12:27:29 +00:00
|
|
|
name: Release build
|
2024-06-14 12:57:34 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- stable
|
2022-06-02 12:27:29 +00:00
|
|
|
|
|
|
|
env:
|
2024-06-14 12:57:34 +00:00
|
|
|
FORCE_COLOR: true
|
2022-06-02 12:27:29 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-linux:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-06-02 12:27:29 +00:00
|
|
|
|
2024-06-14 12:57:34 +00:00
|
|
|
- uses: pnpm/action-setup@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
|
2024-06-14 12:57:34 +00:00
|
|
|
- name: Use Node.js 22
|
|
|
|
uses: actions/setup-node@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
with:
|
2024-06-14 12:57:34 +00:00
|
|
|
node-version: 22
|
2022-11-22 16:14:50 +00:00
|
|
|
cache: "pnpm"
|
2022-10-08 15:43:08 +00:00
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Install Node dependencies
|
2024-06-14 12:57:34 +00:00
|
|
|
run: pnpm i -g cargo-cp-artifact electron-builder && pnpm i
|
2022-06-02 12:27:29 +00:00
|
|
|
|
|
|
|
- name: Build
|
2024-06-14 12:57:34 +00:00
|
|
|
run: pnpm run build && electron-builder --linux && electron-builder --arm64 --linux && electron-builder --armv7l --linux
|
2022-06-02 12:27:29 +00:00
|
|
|
env:
|
2024-06-14 12:57:34 +00:00
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: List all files in the dist directory
|
|
|
|
run: ls -l dist
|
2024-06-14 12:57:34 +00:00
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Delete unpacked builds
|
|
|
|
run: rm -rf dist/linux-unpacked && rm -rf dist/linux-arm64-unpacked && rm -rf dist/linux-armv7l-unpacked
|
2024-06-14 12:57:34 +00:00
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Upload artifact
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-06-02 12:27:29 +00:00
|
|
|
with:
|
|
|
|
name: ArmCordLinux
|
|
|
|
path: dist/
|
|
|
|
|
|
|
|
build-mac:
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-06-02 12:27:29 +00:00
|
|
|
|
2024-06-14 12:57:34 +00:00
|
|
|
- uses: pnpm/action-setup@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
|
2024-06-14 12:57:34 +00:00
|
|
|
- name: Use Node.js 22
|
|
|
|
uses: actions/setup-node@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
with:
|
2024-06-14 12:57:34 +00:00
|
|
|
node-version: 22
|
2022-11-22 16:14:50 +00:00
|
|
|
cache: "pnpm"
|
2022-10-08 15:43:08 +00:00
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Install Node dependencies
|
2024-06-14 12:57:34 +00:00
|
|
|
run: pnpm i -g cargo-cp-artifact electron-builder && pnpm i
|
2022-06-02 12:27:29 +00:00
|
|
|
|
|
|
|
- name: Build
|
2024-06-14 12:57:34 +00:00
|
|
|
run: pnpm run build && electron-builder --macos --x64 --arm64
|
2022-06-02 12:27:29 +00:00
|
|
|
env:
|
2024-06-14 12:57:34 +00:00
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: List all files in the dist directory
|
|
|
|
run: ls -l dist
|
2024-06-14 12:57:34 +00:00
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Delete unpacked builds
|
|
|
|
run: rm -rf dist/macos-unpacked
|
|
|
|
|
|
|
|
- name: Upload artifact
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-06-02 12:27:29 +00:00
|
|
|
with:
|
|
|
|
name: ArmCordMac
|
|
|
|
path: dist/
|
|
|
|
|
|
|
|
build-windows:
|
|
|
|
runs-on: windows-latest
|
2022-11-22 16:14:50 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
|
2024-06-14 12:57:34 +00:00
|
|
|
- uses: pnpm/action-setup@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
|
2024-06-14 12:57:34 +00:00
|
|
|
- name: Use Node.js 22
|
|
|
|
uses: actions/setup-node@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
with:
|
2024-06-14 12:57:34 +00:00
|
|
|
node-version: 22
|
2022-11-22 16:14:50 +00:00
|
|
|
cache: "pnpm"
|
|
|
|
|
|
|
|
- name: Install Node dependencies
|
2024-06-14 12:57:34 +00:00
|
|
|
run: pnpm i -g cargo-cp-artifact electron-builder && pnpm i
|
2022-06-02 12:27:29 +00:00
|
|
|
|
2022-11-22 16:14:50 +00:00
|
|
|
- name: Build
|
2024-06-14 12:57:34 +00:00
|
|
|
run: pnpm run build && electron-builder --windows
|
2022-11-22 16:14:50 +00:00
|
|
|
env:
|
2024-06-14 12:57:34 +00:00
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2022-11-22 16:14:50 +00:00
|
|
|
- name: Delete unpacked builds
|
|
|
|
run: Remove-Item -LiteralPath ".\dist\win-unpacked" -Force -Recurse
|
2024-06-14 12:57:34 +00:00
|
|
|
|
2022-11-22 16:14:50 +00:00
|
|
|
- name: Upload artifact
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
with:
|
|
|
|
name: ArmCordWindows
|
|
|
|
path: dist/
|
2024-06-14 12:57:34 +00:00
|
|
|
|
2022-11-22 16:14:50 +00:00
|
|
|
build-windowsOnARM:
|
|
|
|
runs-on: windows-latest
|
2022-06-02 12:27:29 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: "22"
|
|
|
|
cache: "pnpm"
|
2022-06-02 12:27:29 +00:00
|
|
|
|
2022-11-22 16:14:50 +00:00
|
|
|
- name: Set architecture
|
|
|
|
run: set npm_config_arch=arm64
|
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Install Node dependencies
|
2024-06-14 12:57:34 +00:00
|
|
|
run: pnpm install -g cargo-cp-artifact electron-builder && pnpm install
|
2022-06-02 12:27:29 +00:00
|
|
|
|
|
|
|
- name: Build
|
2024-06-14 12:57:34 +00:00
|
|
|
run: pnpm run build && electron-builder --windows --arm64
|
2022-06-02 12:27:29 +00:00
|
|
|
env:
|
2024-06-14 12:57:34 +00:00
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Delete unpacked builds
|
2022-11-22 16:14:50 +00:00
|
|
|
run: Remove-Item -LiteralPath ".\dist\win-arm64-unpacked" -Force -Recurse
|
2024-06-14 12:57:34 +00:00
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Upload artifact
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-06-02 12:27:29 +00:00
|
|
|
with:
|
2022-11-22 16:14:50 +00:00
|
|
|
name: ArmCordWindowsArm64
|
2022-06-02 12:27:29 +00:00
|
|
|
path: dist/
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-22 16:14:50 +00:00
|
|
|
needs: [build-linux, build-mac, build-windows, build-windowsOnARM]
|
2022-06-02 12:27:29 +00:00
|
|
|
|
|
|
|
steps:
|
2024-06-14 12:57:34 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2022-06-02 12:27:29 +00:00
|
|
|
with:
|
|
|
|
name: ArmCordMac
|
|
|
|
path: macos
|
2024-06-14 12:57:34 +00:00
|
|
|
|
|
|
|
- uses: actions/download-artifact@v4
|
2022-06-02 12:27:29 +00:00
|
|
|
with:
|
|
|
|
name: ArmCordWindows
|
|
|
|
path: windows
|
2024-06-14 12:57:34 +00:00
|
|
|
|
|
|
|
- uses: actions/download-artifact@v4
|
2022-11-22 16:14:50 +00:00
|
|
|
with:
|
|
|
|
name: ArmCordWindowsArm64
|
|
|
|
path: windows
|
2024-06-14 12:57:34 +00:00
|
|
|
|
|
|
|
- uses: actions/download-artifact@v4
|
2022-06-02 12:27:29 +00:00
|
|
|
with:
|
|
|
|
name: ArmCordLinux
|
|
|
|
path: linux
|
2024-06-14 12:57:34 +00:00
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: ls
|
|
|
|
run: ls
|
2024-06-14 12:57:34 +00:00
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Delete unwanted directories
|
|
|
|
run: rm -rf {linux,macos,windows}/*/
|
2024-06-14 12:57:34 +00:00
|
|
|
rm -rf {linux,macos,windows}/.icon*
|
|
|
|
rm -rf {linux,macos,windows}/builder-debug.yml
|
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: ls dirs
|
2024-06-14 12:57:34 +00:00
|
|
|
run: ls linux && ls macos && ls windows
|
|
|
|
|
2022-06-02 12:27:29 +00:00
|
|
|
- name: Get some values needed for the release
|
|
|
|
id: vars
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2024-06-14 12:57:34 +00:00
|
|
|
echo "::set-output name=releaseTag::$(git describe --tags --abbrev=0)"
|
2022-06-02 12:27:29 +00:00
|
|
|
|
|
|
|
- name: Create Release
|
2024-06-14 12:57:34 +00:00
|
|
|
uses: actions/github-script@v7
|
2022-06-02 12:27:29 +00:00
|
|
|
with:
|
2024-06-14 12:57:34 +00:00
|
|
|
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}`)
|
|
|
|
});
|
|
|
|
}
|
2022-06-02 12:27:29 +00:00
|
|
|
env:
|
2024-06-14 12:57:34 +00:00
|
|
|
releaseTag: ${{ steps.vars.outputs.releaseTag }}
|