armcord/.github/workflows/dev.yml

174 lines
5.3 KiB
YAML
Raw Normal View History

2022-04-19 18:13:46 +00:00
name: Dev build
on:
push:
branches:
- dev
2022-04-19 18:13:46 +00:00
env:
FORCE_COLOR: true
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
2022-10-11 18:45:24 +00:00
- uses: pnpm/action-setup@v2 # Install pnpm using packageManager key in package.json
2022-10-08 16:24:42 +00:00
2022-10-11 18:45:24 +00:00
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: 18
cache: "pnpm"
2022-10-08 15:43:08 +00:00
2022-04-19 18:13:46 +00:00
- name: Install Node dependencies
2022-10-08 16:11:34 +00:00
run: pnpm install -g cargo-cp-artifact && pnpm install
2022-04-19 18:13:46 +00:00
- name: Install Electron-Builder
2022-10-08 15:43:08 +00:00
run: pnpm install -g electron-builder
2022-04-19 18:13:46 +00:00
- name: Replace the version number
run: cat src/utils.ts | sed -e 's/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/DEV/g' | tee src/utils.ts > /dev/null
2022-04-19 18:13:46 +00:00
- name: Build
2022-04-20 14:52:37 +00:00
run: npm run build && electron-builder --linux zip && electron-builder --arm64 --linux zip
2022-04-19 18:13:46 +00:00
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ArmCordLinux.zip
path: dist/ArmCord-3.1.0.zip
2022-04-20 14:52:37 +00:00
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ArmCordLinuxArm64.zip
path: dist/ArmCord-3.1.0-arm64.zip
2022-04-19 18:13:46 +00:00
build-mac:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
2022-10-11 18:45:24 +00:00
- uses: pnpm/action-setup@v2 # Install pnpm using packageManager key in package.json
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: 18
cache: "pnpm"
2022-10-08 15:43:08 +00:00
2022-04-19 18:13:46 +00:00
- name: Install Node dependencies
2022-10-08 16:11:34 +00:00
run: pnpm install -g cargo-cp-artifact && pnpm install
2022-10-08 15:43:08 +00:00
2022-04-19 18:13:46 +00:00
- name: Install Electron-Builder
2022-10-08 15:43:08 +00:00
run: pnpm install -g electron-builder
2022-04-19 18:13:46 +00:00
- name: Replace the version number
run: cat src/utils.ts | sed -e 's/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/DEV/g' | tee src/utils.ts > /dev/null
2022-04-19 18:13:46 +00:00
- name: Build
run: npm run build && electron-builder --macos zip
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ArmCordMac.zip
path: dist/ArmCord-3.1.0-mac.zip
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
2022-10-11 18:45:24 +00:00
- uses: pnpm/action-setup@v2 # Install pnpm using packageManager key in package.json
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: 18
cache: "pnpm"
2022-10-08 15:43:08 +00:00
2022-04-19 18:13:46 +00:00
- name: Install Node dependencies
2022-10-11 18:58:13 +00:00
run: pnpm install -g cargo-cp-artifact && pnpm install
2022-10-08 15:43:08 +00:00
2022-04-19 18:13:46 +00:00
- name: Install Electron-Builder
2022-10-11 18:58:13 +00:00
run: pnpm install -g electron-builder
2022-04-19 18:13:46 +00:00
- name: Replace the version number
run: (Get-Content src/utils.ts) -replace "\d\.\d\.\d", "DEV" | Out-File src/utils.ts
2022-04-19 18:13:46 +00:00
- name: Build
run: npm run build && electron-builder --windows zip
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ArmCordWindows.zip
path: dist/ArmCord-3.1.0-win.zip
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.zip
path: macos
- uses: actions/download-artifact@v2
with:
name: ArmCordWindows.zip
path: windows
- uses: actions/download-artifact@v2
with:
name: ArmCordLinux.zip
path: linux
2022-04-20 14:52:37 +00:00
- uses: actions/download-artifact@v2
with:
name: ArmCordLinuxArm64.zip
path: linux
2022-04-19 18:13:46 +00:00
- name: Get some values needed for the release
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
2022-04-20 14:52:37 +00:00
- uses: dev-drprasad/delete-tag-and-release@v0.2.0
with:
delete_release: true
tag_name: devbuild
2022-04-20 14:53:50 +00:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-04-19 18:13:46 +00:00
- name: Create the release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2022-04-20 14:52:37 +00:00
tag_name: devbuild
2022-04-19 18:13:46 +00:00
name: Dev Build ${{ steps.vars.outputs.sha_short }}
draft: false
prerelease: true
body_path: .github/release.md
files: |
linux/ArmCord-3.1.0.zip
2022-04-20 14:52:37 +00:00
linux/ArmCord-3.1.0-arm64.zip
2022-04-19 18:13:46 +00:00
macos/ArmCord-3.1.0-mac.zip
2022-04-20 14:52:37 +00:00
windows/ArmCord-3.1.0-win.zip