Skip to content

Manifest v3 compatibility #173

Manifest v3 compatibility

Manifest v3 compatibility #173

name: Build release
on:
push:
tags:
- "v*.*.*"
pull_request:
branches:
- main
jobs:
build-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '17.x'
- name: Write version number
if: startsWith(github.ref, 'refs/tags/v')
run: bash .github/deploy-tag.sh
- name: Install dependencies
run: npm install
- name: Run linter
run: npm run lint:js
continue-on-error: true
- name: Build
run: npm run build
- name: Upload extension artifact
uses: actions/upload-artifact@v2
with:
name: extension-artefacts
if-no-files-found: error
path: ${{github.workspace}}/web-ext-artifacts/translatelocally.xpi
- name: Update development prerelease
uses: marvinpinto/action-automatic-releases@latest
if: github.ref == 'refs/heads/main'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: development-latest
prerelease: true
title: "Latest Development Build"
files: |
./web-ext-artifacts/translatelocally.xpi
- name: Sign extension
if: startsWith(github.ref, 'refs/tags/v')
continue-on-error: true
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
run: |
npm run sign
- name: Create release
id: create_release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./web-ext-artifacts/translatelocally.xpi
asset_name: translatelocally.xpi
asset_content_type: application/zip