build-trigger #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Extension | |
on: | |
repository_dispatch: | |
types: [build-trigger] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
actions: read | |
contents: write | |
attestations: write | |
steps: | |
- name: Checkout Extension Repo | |
uses: actions/checkout@v4 | |
- name: Uses PNPM | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
run_install: false | |
- name: Uses Node.js 18.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'pnpm' | |
- name: Clone FrankerFaceZ Repository | |
run: | | |
git clone https://github.com/FrankerFaceZ/FrankerFaceZ.git client | |
- name: Clone Add-Ons Repository | |
run: | | |
git clone https://github.com/FrankerFaceZ/Add-Ons.git addons | |
- name: Calculate and Log Version | |
run: | | |
./scripts/calculate-version.sh | |
cat .env >> $GITHUB_ENV | |
- name: Make a Source Artifact for Firefox | |
id: source-upload-step | |
uses: actions/upload-artifact@v4 | |
with: | |
name: source | |
path: | | |
client/* | |
addons/* | |
src/* | |
scripts/* | |
ffz_env | |
README.md | |
- name: Build the Main Client | |
run: | | |
cd client | |
pnpm install | |
pnpm build:ext | |
cd .. | |
- name: Build the Add-Ons Repository | |
run: | | |
cd addons | |
pnpm install | |
pnpm build:ext | |
cd .. | |
- name: Copy Build Output | |
run: | | |
./scripts/copy-output.sh | |
- name: Edit Manifest (Insert Version) | |
run: node scripts/update-manifest.js | |
- name: Package Extension | |
if: success() | |
run: | | |
cd dist | |
zip -r ../frankerfacez-extension-$FFZ_VERSION.$FFZ_BUILD.zip * | |
cd .. | |
- name: Attest Extension | |
if: success() | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: frankerfacez-extension-${{ env.FFZ_VERSION }}.${{ env.FFZ_BUILD }}.zip | |
- name: Upload Extension | |
id: artifact-upload-step | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: extension | |
path: frankerfacez-extension-${{ env.FFZ_VERSION }}.${{ env.FFZ_BUILD }}.zip | |
- name: Now, Nightly | |
if: success() | |
run: | | |
node scripts/nightly-manifest.js | |
- name: Package Nightly | |
if: success() | |
run: | | |
cd dist | |
zip -r ../frankerfacez-nightly-$FFZ_VERSION.$FFZ_BUILD.zip * | |
cd .. | |
- name: Attest Nightly | |
if: success() | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: frankerfacez-nightly-${{ env.FFZ_VERSION }}.${{ env.FFZ_BUILD }}.zip | |
- name: Upload Nightly | |
id: artifact-upload-step-nightly | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nightly | |
path: frankerfacez-nightly-${{ env.FFZ_VERSION }}.${{ env.FFZ_BUILD }}.zip | |
- name: Report Success | |
if: success() | |
uses: tsickert/discord-webhook@v6.0.0 | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
embed-color: 3066993 | |
embed-title: ✅ Extension Build Succeeded | |
embed-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
embed-description: | | |
**Version**: ${{ env.FFZ_VERSION }}.${{ env.FFZ_BUILD }} | |
**Main Client Commit**: [${{ env.CLIENT_COMMIT }}](<https://github.com/FrankerFaceZ/FrankerFaceZ/commit/${{ env.CLIENT_COMMIT }}>) | |
**Add-Ons Commit**: [${{ env.ADDONS_COMMIT }}](<https://github.com/FrankerFaceZ/Add-Ons/commit/${{ env.ADDONS_COMMIT }}>) | |
``` | |
${{ env.LATEST_MESSAGE }}``` | |
[Download Source](<${{ steps.source-upload-step.outputs.artifact-url }}>) | |
[Download Extension](<${{ steps.artifact-upload-step.outputs.artifact-url }}>) | |
[Download Nightly](<${{ steps.artifact-upload-step-nightly.outputs.artifact-url }}>) | |
- name: Report Failure | |
if: failure() | |
uses: tsickert/discord-webhook@v6.0.0 | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
embed-color: 15158332 | |
embed-title: ❌ Extension Build Failed | |
embed-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
embed-description: | | |
**Version**: ${{ env.FFZ_VERSION }}.${{ env.FFZ_BUILD }} | |
**Main Client Commit**: [${{ env.CLIENT_COMMIT }}](<https://github.com/FrankerFaceZ/FrankerFaceZ/commit/${{ env.CLIENT_COMMIT }}>) | |
**Add-Ons Commit**: [${{ env.ADDONS_COMMIT }}](<https://github.com/FrankerFaceZ/Add-Ons/commit/${{ env.ADDONS_COMMIT }}>) | |
``` | |
${{ env.LATEST_MESSAGE }}``` | |
Please check the logs for details. | |
[Download Source](<${{ steps.source-upload-step.outputs.artifact-url }}>) | |
publish-nightly: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ needs.build.result == 'success' }} | |
steps: | |
- name: Checkout Extension Repo | |
uses: actions/checkout@v4 | |
- name: Download Nightly Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: nightly | |
path: dist | |
- name: Publish to Chrome Web Store | |
uses: mnao305/chrome-extension-upload@v5.0.0 | |
with: | |
glob: true | |
file-path: dist/frankerfacez-nightly-*.zip | |
extension-id: jgnjpfcdneiofkjkidlokfipfaignogj | |
client-id: ${{ secrets.GOOGLE_CLIENT_ID }} | |
client-secret: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
refresh-token: ${{ secrets.GOOGLE_REFRESH_TOKEN }} | |
- name: Report Success | |
if: success() | |
uses: tsickert/discord-webhook@v6.0.0 | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
embed-color: 3066993 | |
embed-title: ✅ Chrome Nightly Upload Succeeded | |
embed-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
- name: Report Failure | |
if: failure() | |
uses: tsickert/discord-webhook@v6.0.0 | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
embed-color: 15158332 | |
embed-title: ❌ Chrome Nightly Upload Failed | |
embed-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |