name: Build Branches on: push: branches: - main - dev - i18n_translation - translation - bun - dev2 workflow_dispatch: inputs: branch: type: choice description: "Branch to build and upload" options: - main - dev - translation default: "dev" env: FORCE_COLOR: true GITHUB_TOKEN: ${{ secrets.ETOKEN }} REPO: Equicord/Equibuilds USERNAME: GitHub-Actions permissions: contents: write jobs: Build: name: Build Equicord runs-on: ubuntu-latest if: github.repository == 'Equicord/Equicord' steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.inputs.branch || github.ref }} - name: Setup PNPM if: github.ref_name != 'bun' uses: pnpm/setup@v2.1.0 with: runtime: node@v24 require-lockfile: true - name: Build web if: github.ref_name != 'bun' run: pnpm buildWebStandalone - name: Build if: github.ref_name != 'bun' run: pnpm buildStandalone - name: Generate plugin lists if: github.ref_name != 'bun' run: | pnpm generatePluginJson dist/plugins.json pnpm generateEquicordPluginJson dist/equicordplugins.json pnpm generateVencordPluginJson dist/vencordplugins.json pnpm generateDevsList dist/devs.json - uses: oven-sh/setup-bun@v2 if: github.ref_name == 'bun' with: bun-version: latest - name: Install dependencies if: github.ref_name == 'bun' run: bun install - name: Build web if: github.ref_name == 'bun' run: bun run buildWebStandalone - name: Build if: github.ref_name == 'bun' run: bun run buildStandalone - name: Generate plugin lists if: github.ref_name == 'bun' run: | bun run generatePluginJson dist/plugins.json bun run generateEquicordPluginJson dist/equicordplugins.json bun run generateVencordPluginJson dist/vencordplugins.json bun run generateDevsList dist/devs.json - name: Upload to Equibuilds repo if: ${{ vars.ACT == 'false' }} run: | BRANCH="${{ github.event.inputs.branch || github.ref_name }}" COMMIT_SHA=$(git rev-parse --short HEAD) git config --global user.name "GitHub-Actions" git config --global user.email actions@github.com mkdir equibuilds && cd equibuilds git init -b "$BRANCH" git remote add origin https://$USERNAME:$GITHUB_TOKEN@github.com/$REPO.git if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then git fetch --depth 1 origin "$BRANCH" git checkout "$BRANCH" else git checkout --orphan "$BRANCH" fi cp -r ../dist/* . find . -size 0 -delete mkdir -p userscript mv Equicord.user.* userscript/ mv desktop.asar desktop/ mv equibop.asar equibop/ mv extension-*.zip browser/ git add -A git commit -m "Builds for https://github.com/$GITHUB_REPOSITORY/commit/$COMMIT_SHA" git push --force origin "$BRANCH"