2022-12-02 08:21:44 -05:00
|
|
|
name: Build DevBuild
|
2022-10-11 09:19:04 -04:00
|
|
|
on:
|
2024-04-17 14:29:47 -04:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- .github/workflows/build.yml
|
|
|
|
- src/**
|
|
|
|
- browser/**
|
|
|
|
- scripts/build/**
|
|
|
|
- package.json
|
|
|
|
- pnpm-lock.yaml
|
2022-10-11 09:19:04 -04:00
|
|
|
env:
|
2024-04-17 14:29:47 -04:00
|
|
|
FORCE_COLOR: true
|
2024-07-17 16:04:47 -04:00
|
|
|
GITHUB_TOKEN: ${{ secrets.ETOKEN }}
|
2022-10-11 09:19:04 -04:00
|
|
|
|
|
|
|
jobs:
|
2024-04-17 14:29:47 -04:00
|
|
|
DetermineRunner:
|
|
|
|
name: Determine Runner
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
runner: ${{ steps.set-runner.outputs.runner }}
|
|
|
|
steps:
|
|
|
|
- name: Determine which runner to use
|
|
|
|
id: set-runner
|
|
|
|
uses: benjaminmichaelis/get-soonest-available-runner@v1.1.0
|
|
|
|
with:
|
|
|
|
primary-runner: "self-hosted"
|
|
|
|
fallback-runner: "ubuntu-latest"
|
|
|
|
min-available-runners: 1
|
|
|
|
github-token: ${{ env.GITHUB_TOKEN }}
|
2022-10-11 09:19:04 -04:00
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
Build:
|
|
|
|
name: Build Equicord
|
|
|
|
needs: DetermineRunner
|
|
|
|
runs-on: ${{ needs.DetermineRunner.outputs.runner}}
|
2022-10-11 09:19:04 -04:00
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2022-10-11 09:19:04 -04:00
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
- uses: pnpm/action-setup@v3
|
2022-10-11 09:19:04 -04:00
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
- name: Use Node.js 20
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20
|
|
|
|
cache: "pnpm"
|
2022-10-11 09:19:04 -04:00
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install --frozen-lockfile
|
2022-10-13 18:12:30 -04:00
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
- name: Build web
|
2024-06-01 13:14:59 -04:00
|
|
|
run: pnpm buildWebStandalone
|
2022-10-13 18:12:30 -04:00
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
- name: Build
|
|
|
|
run: pnpm build --standalone
|
2023-03-22 23:37:32 -04:00
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
- name: Generate plugin list
|
|
|
|
run: pnpm generatePluginJson dist/plugins.json dist/plugin-readmes.json
|
2022-12-01 13:16:09 -05:00
|
|
|
|
2024-07-18 18:14:06 -04:00
|
|
|
- name: Generate Equicord plugin list
|
|
|
|
run: pnpm generateEquicordPluginJson dist/equicordplugins.json
|
|
|
|
|
2024-04-17 14:29:47 -04:00
|
|
|
- name: Clean up obsolete files
|
|
|
|
run: |
|
|
|
|
rm -rf dist/*-unpacked dist/monaco Vencord.user.css vencordDesktopRenderer.css vencordDesktopRenderer.css.map
|
2022-11-07 15:38:14 -05:00
|
|
|
|
2024-07-17 16:18:29 -04:00
|
|
|
- name: Upload Equicord
|
2024-04-17 14:29:47 -04:00
|
|
|
if: github.repository == 'Equicord/Equicord'
|
|
|
|
run: |
|
|
|
|
gh release upload latest --clobber dist/*
|
2024-07-18 18:14:06 -04:00
|
|
|
|
2024-07-18 18:16:31 -04:00
|
|
|
- name: Upload Plugins JSON to Ignore repo
|
2024-07-18 18:14:06 -04:00
|
|
|
if: github.repository == 'Equicord/Equicord'
|
|
|
|
run: |
|
|
|
|
git config --global user.name "$USERNAME"
|
|
|
|
git config --global user.email "78185467+thororen1234@users.noreply.github.com"
|
|
|
|
|
|
|
|
git clone https://$USERNAME:$API_TOKEN@github.com/$GH_REPO.git upload
|
|
|
|
cd upload
|
|
|
|
|
|
|
|
rm plugins.json
|
|
|
|
cp -r ../dist/equicordplugins.json plugins.json
|
|
|
|
|
|
|
|
git add -A
|
|
|
|
git commit -m "Plugins for https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA"
|
|
|
|
git push --force https://$USERNAME:$API_TOKEN@github.com/$GH_REPO.git
|
|
|
|
env:
|
|
|
|
API_TOKEN: ${{ secrets.ETOKEN }}
|
|
|
|
GH_REPO: Equicord/Ignore
|
|
|
|
USERNAME: thororen1234
|