Skip to content

Translation updates from Crowdin (#752) #358

Translation updates from Crowdin (#752)

Translation updates from Crowdin (#752) #358

Workflow file for this run

name: Extension CI/CD
on:
push:
paths:
- .github/workflows/extension.yaml
- extension/**
tags:
- v*
branches-ignore:
- crowdin-*
pull_request:
paths:
- .github/workflows/extension.yaml
- extension/**
defaults:
run:
working-directory: extension
shell: bash
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Harden runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Enable Corepack
run: corepack enable
- name: Configure cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/.cache/yarn
~/.config/yarn
~/.yarn/berry/cache
key: ${{ runner.os }}-yarn-lint-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
- name: Install dependencies
run: yarn install --immutable
- name: Lint the extension
run: yarn lint
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
attestations: write
id-token: write
steps:
- name: Harden runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Enable Corepack
run: corepack enable
- name: Configure cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/.cache/yarn
~/.config/yarn
~/.yarn/berry/cache
key: ${{ runner.os }}-yarn-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Set the version
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]
then
VERSION=${GITHUB_REF/refs\/tags\/v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"$VERSION\"/g" package.json
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"$VERSION\"/g" src/manifest.json
else
echo "VERSION=0.0.0" >> $GITHUB_ENV
fi
- name: Package the extension source
run: 7z a "dist/firefoxpwa-${{ env.VERSION }}-source.zip" "." -bd -mx9 -xr@"../.gitignore"
- name: Upload the extension source
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: firefoxpwa-extension-source
path: extension/dist/firefoxpwa-*-source.zip
compression-level: 0
- name: Attest the extension source
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
with:
subject-path: extension/dist/firefoxpwa-*-source.zip
- name: Install Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
- name: Install dependencies
run: yarn install --immutable
- name: Build the extension
run: yarn build
- name: Upload the compiled extension
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: firefoxpwa-extension-compiled
path: extension/dist/firefoxpwa-*-compiled.zip
compression-level: 0
- name: Attest the compiled extension
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
with:
subject-path: extension/dist/firefoxpwa-*-compiled.zip
# Add auto-publishing to AMO once web-ext supports submitting extensions from ZIP files
# This also includes uploading source code and AMO release notes
# See: https://github.com/mozilla/web-ext/issues/3242