2022-05-23 14:53:16 +00:00
|
|
|
name: Release build
|
2022-05-23 14:07:22 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- stable
|
|
|
|
|
2022-05-23 14:53:16 +00:00
|
|
|
env:
|
|
|
|
FORCE_COLOR: true
|
|
|
|
|
2022-05-23 14:07:22 +00:00
|
|
|
jobs:
|
2022-05-23 14:53:16 +00:00
|
|
|
build-linux:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '18'
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Install Electron-Builder
|
|
|
|
run: npm install -g electron-builder
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: npm run build && electron-builder --linux && electron-builder --arm64 --linux && electron-builder --armv7l --linux
|
2022-05-23 16:24:07 +00:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-05-24 10:03:03 +00:00
|
|
|
- name: List all files in the dist directory
|
|
|
|
run: ls dist
|
2022-05-23 14:53:16 +00:00
|
|
|
- name: Delete unpacked builds
|
2022-05-23 16:24:07 +00:00
|
|
|
run: rm -rf dist/linux-unpacked && rm -rf dist/linux-arm64-unpacked && rm -rf dist/linux-armv7l-unpacked
|
2022-05-23 14:53:16 +00:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ArmCordLinux
|
|
|
|
path: dist/
|
|
|
|
|
|
|
|
|
|
|
|
build-mac:
|
|
|
|
runs-on: macos-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '18'
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Install Electron-Builder
|
|
|
|
run: npm install -g electron-builder
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: npm run build && electron-builder --macos
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-05-24 10:03:03 +00:00
|
|
|
- name: List all files in the dist directory
|
|
|
|
run: ls dist
|
2022-05-23 14:53:16 +00:00
|
|
|
- name: Delete unpacked builds
|
|
|
|
run: rm -rf dist/macos-unpacked
|
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ArmCordMac
|
|
|
|
path: dist/
|
|
|
|
|
|
|
|
build-windows:
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '18'
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Install Electron-Builder
|
|
|
|
run: npm install -g electron-builder
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: npm run build && electron-builder --windows
|
2022-05-23 14:58:30 +00:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-05-23 14:53:16 +00:00
|
|
|
- name: Delete unpacked builds
|
2022-05-23 16:15:19 +00:00
|
|
|
run: Remove-Item -LiteralPath ".\dist\win-unpacked" -Force -Recurse
|
2022-05-23 14:53:16 +00:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ArmCordWindows
|
|
|
|
path: dist/
|
|
|
|
|
|
|
|
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build-linux, build-mac, build-windows]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ArmCordMac
|
|
|
|
path: macos
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ArmCordWindows
|
|
|
|
path: windows
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ArmCordLinux
|
|
|
|
path: linux
|
|
|
|
|
|
|
|
- name: Get some values needed for the release
|
|
|
|
id: vars
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=releaseTag::$(git describe --tags --abbrev=0)"
|
|
|
|
|
|
|
|
- uses: dev-drprasad/delete-tag-and-release@v0.2.0
|
|
|
|
with:
|
|
|
|
delete_release: true
|
2022-05-23 17:07:14 +00:00
|
|
|
tag_name: v3.0.6
|
2022-05-23 14:53:16 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create Release
|
|
|
|
uses: actions/github-script@v2
|
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
script: |
|
|
|
|
console.log('environment', process.versions);
|
|
|
|
|
2022-05-24 10:03:03 +00:00
|
|
|
const fs = require('fs');
|
2022-05-23 14:53:16 +00:00
|
|
|
|
|
|
|
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);
|
2022-05-23 19:52:10 +00:00
|
|
|
if (await fs.stat(`./linux/${file}`).isDirectory()) {
|
2022-05-23 17:43:00 +00:00
|
|
|
console.log("directory, skipping")
|
|
|
|
} else {
|
2022-05-23 14:53:16 +00:00
|
|
|
await github.repos.uploadReleaseAsset({
|
|
|
|
owner, repo,
|
|
|
|
release_id: release.data.id,
|
|
|
|
name: file,
|
|
|
|
data: await fs.readFile(`./linux/${file}`)
|
2022-05-23 17:43:00 +00:00
|
|
|
});
|
|
|
|
}
|
2022-05-23 14:53:16 +00:00
|
|
|
}
|
|
|
|
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);
|
2022-05-23 19:52:10 +00:00
|
|
|
if (await fs.stat(`./windows/${file}`).isDirectory()) {
|
2022-05-23 17:43:00 +00:00
|
|
|
console.log("directory, skipping")
|
|
|
|
} else {
|
2022-05-23 14:53:16 +00:00
|
|
|
await github.repos.uploadReleaseAsset({
|
|
|
|
owner, repo,
|
|
|
|
release_id: release.data.id,
|
|
|
|
name: file,
|
|
|
|
data: await fs.readFile(`./windows/${file}`)
|
2022-05-23 17:43:00 +00:00
|
|
|
});
|
|
|
|
}
|
2022-05-23 14:53:16 +00:00
|
|
|
}
|
|
|
|
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);
|
|
|
|
|
2022-05-23 19:52:10 +00:00
|
|
|
if (await fs.stat(`./macos/${file}`).isDirectory()) {
|
2022-05-23 17:43:00 +00:00
|
|
|
console.log("directory, skipping")
|
|
|
|
} else {
|
2022-05-23 14:53:16 +00:00
|
|
|
await github.repos.uploadReleaseAsset({
|
|
|
|
owner, repo,
|
|
|
|
release_id: release.data.id,
|
|
|
|
name: file,
|
|
|
|
data: await fs.readFile(`./macos/${file}`)
|
2022-05-23 17:43:00 +00:00
|
|
|
});
|
|
|
|
}
|
2022-05-23 14:53:16 +00:00
|
|
|
}
|
2022-05-23 17:07:14 +00:00
|
|
|
env:
|
|
|
|
releaseTag: ${{ steps.vars.outputs.releaseTag }}
|