armcord/.github/workflows/dev.yml
smartfrigde e8b9e07008 ci: fix
2024-06-15 12:37:08 +02:00

201 lines
5.8 KiB
YAML

name: Dev build
on:
push:
branches:
- dev
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
- name: Build
run: pnpm run build && pnpm electron-builder --linux zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ArmCordLinux
path: dist/armcord-*.zip
build-snap:
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
- name: Build
run: pnpm run build && pnpm electron-builder --linux snap --config.snap.grade=devel
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: dist/armcord.3.0_amd64.snap
release: edge
build-snap-arm64:
runs-on: warp-ubuntu-latest-arm64-2x
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 snapcraft
run: sudo apt install snapd && sudo snap install snapcraft --classic
- name: Install Node dependencies
run: pnpm i
- name: Build
run: pnpm run build && pnpm electron-builder --linux snap --config.snap.grade=devel
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: dist/armcord_3.3.0_arm64.snap
release: edge
build-linux-arm:
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
- name: Build
run: pnpm run build && pnpm electron-builder --arm64 --linux zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ArmCordLinuxArm64
path: dist/armcord-*-arm64.zip
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
- name: Build
run: pnpm run build && pnpm electron-builder --windows zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ArmCordWindows
path: dist/armcord-3.3.0-win.zip
build-windows-arm:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Set architecture
run: set npm_config_arch=arm64
- uses: pnpm/action-setup@v4 # Install pnpm using packageManager key in package.json
- name: Install Node dependencies
run: pnpm i
- name: Build
run: pnpm run build && pnpm electron-builder --windows zip --arm64
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ArmCordWindowsArm64
path: dist\armcord-3.3.0-arm64-win.zip
release:
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-windows-arm, build-linux-arm]
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: release-files
- name: Get short commit hash
id: vars
run: echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
- run: gh release delete devbuild -y --cleanup-tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bodyFile: .github/release.md
generateReleaseNotes: false
name: Dev Build ${{ steps.vars.outputs.sha_short }}
prerelease: true
tag: devbuild
artifacts: "release-files/**/*.zip"