Skip to content

No need to update package json files #3558

No need to update package json files

No need to update package json files #3558

Workflow file for this run

name: Node
on:
- push
env:
ARTIFACTS_DIR: ${{ vars.ARTIFACTS_DIR }}
ARTIFACT_FIREFOX_FILENAME: ${{ vars.ARTIFACT_FIREFOX_FILENAME }}
ARTIFACT_CHROMIUM_FILENAME: ${{ vars.ARTIFACT_CHROMIUM_FILENAME }}
ARTIFACT_ARCHIVE_FILENAME: ${{ vars.ARTIFACT_ARCHIVE_FILENAME }}
FIREFOX_ADDON_ID: ${{ vars.FIREFOX_ADDON_ID }}
CHROME_EXTENSION_ID: ${{ vars.CHROME_EXTENSION_ID }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
attestations: write
outputs:
firefox-artifact-id: ${{ steps.upload-firefox-artifact.outputs.artifact-id }}
chromium-artifact-id: ${{ steps.upload-chromium-artifact.outputs.artifact-id }}
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Build Firefox extension
run: npm run build:firefox
- uses: actions/upload-artifact@v4
id: upload-firefox-artifact
name: Upload Firefox artifact
with:
name: aria2-integration-firefox
path: dist
- name: Build Chromium extension
run: npm run build:chromium
- uses: actions/upload-artifact@v4
id: upload-chromium-artifact
name: Upload Chromium artifact
with:
name: aria2-integration-chromium
path: dist
- name: Download artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir "$ARTIFACTS_DIR"
gh api /repos/${{ github.repository }}/actions/artifacts/${{ steps.upload-firefox-artifact.outputs.artifact-id }}/zip > "$ARTIFACTS_DIR/$ARTIFACT_FIREFOX_FILENAME"
gh api /repos/${{ github.repository }}/actions/artifacts/${{ steps.upload-chromium-artifact.outputs.artifact-id }}/zip > "$ARTIFACTS_DIR/$ARTIFACT_CHROMIUM_FILENAME"
- name: Attest artifacts
uses: actions/attest-build-provenance@v2
with:
subject-path: |
${{ env.ARTIFACTS_DIR }}/${{ env.ARTIFACT_FIREFOX_FILENAME }}
${{ env.ARTIFACTS_DIR }}/${{ env.ARTIFACT_CHROMIUM_FILENAME }}
release:
name: Release
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Download artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir "$ARTIFACTS_DIR"
gh api /repos/${{ github.repository }}/actions/artifacts/${{ needs.build.outputs.firefox-artifact-id }}/zip > "$ARTIFACTS_DIR/$ARTIFACT_FIREFOX_FILENAME"
gh api /repos/${{ github.repository }}/actions/artifacts/${{ needs.build.outputs.chromium-artifact-id }}/zip > "$ARTIFACTS_DIR/$ARTIFACT_CHROMIUM_FILENAME"
- name: Verify artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
gh attestation verify "$ARTIFACTS_DIR/$ARTIFACT_FIREFOX_FILENAME" --repo ${{ github.repository }}
gh attestation verify "$ARTIFACTS_DIR/$ARTIFACT_CHROMIUM_FILENAME" --repo ${{ github.repository }}
- name: Archive repository
run: git archive --format zip --output "$ARTIFACTS_DIR/$ARTIFACT_ARCHIVE_FILENAME" ${{ github.ref_name }}
- name: Release Firefox extension
uses: baptistecdr/release-firefox-addon@v1.0.3
if: ${{ vars.RELEASE_FIREFOX_EXTENSION == 'true' }}
with:
addon-id: ${{ env.FIREFOX_ADDON_ID }}
auth-api-issuer: ${{ secrets.MOZILLA_ADDONS_API_KEY }}
auth-api-secret: ${{ secrets.MOZILLA_ADDONS_API_SECRET }}
addon-path: ${{ env.ARTIFACTS_DIR }}/${{ env.ARTIFACT_FIREFOX_FILENAME }}
source-path: ${{ env.ARTIFACTS_DIR }}/${{ env.ARTIFACT_ARCHIVE_FILENAME }}
release-note: 'Release ${{ github.ref_name }}'
- name: Release Microsoft Edge extension
uses: baptistecdr/release-edge-extension@v1.0.1
if: ${{ vars.RELEASE_EDGE_EXTENSION == 'true' }}
with:
api-key: ${{ secrets.MS_API_KEY }}
client-id: ${{ secrets.MS_API_CLIENT_ID }}
product-id: ${{ secrets.EDGE_PRODUCT_ID }}
product-path: ${{ env.ARTIFACTS_DIR }}/${{ env.ARTIFACT_CHROMIUM_FILENAME }}
- name: Release Chrome extension
uses: baptistecdr/release-chrome-extension@v1.0.6
if: ${{ vars.RELEASE_CHROME_EXTENSION == 'true' }}
with:
extension-id: ${{ env.CHROME_EXTENSION_ID }}
extension-path: ${{ env.ARTIFACTS_DIR }}/${{ env.ARTIFACT_CHROMIUM_FILENAME }}
oauth-client-id: ${{ secrets.GOOGLE_API_CLIENT_ID }}
oauth-client-secret: ${{ secrets.GOOGLE_API_CLIENT_SECRET }}
oauth-refresh-token: ${{ secrets.GOOGLE_API_REFRESH_TOKEN }}