Skip to content

Patch 3.0.2

Patch 3.0.2 #36

Workflow file for this run

name: Release pipeline
on:
release:
types: [ released ]
workflow_dispatch:
inputs:
targets:
description: Targets
required: true
default: '["chrome","firefox"]'
type: choice
options:
- '["chrome","firefox"]'
- '["chrome"]'
- '["firefox"]'
firefox:
description: Deploy Firefox
type: boolean
default: true
chrome:
description: Deploy Chrome
type: boolean
default: true
edge:
description: Deploy Edge
type: boolean
default: true
gh-release:
description: Attach to GitHub release
type: boolean
default: true
jobs:
build:
runs-on: ubuntu-latest
container: node:20
strategy:
fail-fast: false
matrix:
target: ${{ fromJSON(github.event.inputs.targets || '["chrome","firefox"]') }}
steps:
- uses: actions/checkout@main
- run: yarn install
- run: yarn lint
- run: TARGET=${{ matrix.target }} yarn build
- name: Drop build artifacts (${{ matrix.target }})
uses: actions/upload-artifact@main
with:
name: ${{ matrix.target }}
path: dist
- name: web-ext lint
if: ${{ matrix.target == 'firefox' }}
uses: freaktechnik/web-ext-lint@main
with:
extension-root: dist
self-hosted: false
- uses: cardinalby/[email protected]
with:
extensionDir: dist
zipFilePath: PasswordGenerator-${{ matrix.target }}.zip
- name: Drop packed artifacts (${{ matrix.target }})
uses: actions/upload-artifact@main
with:
name: packed-${{ matrix.target }}
path: PasswordGenerator-${{ matrix.target }}.zip
publish-github:
needs: build
if: ${{ github.event_name == 'release' || github.event.inputs.gh-release == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ${{ fromJSON(github.event.inputs.targets || '["chrome","firefox"]') }}
steps:
- uses: actions/download-artifact@main
with:
name: packed-${{ matrix.target }}
- name: Attach build to release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: PasswordGenerator-${{ matrix.target }}.zip
draft: false
overwrite: true
update_latest_release: true
publish-chrome:
needs: build
if: ${{ github.event_name == 'release' || (github.event.inputs.chrome == 'true' && contains(github.event.inputs.targets, 'chrome')) }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@main
with:
name: packed-chrome
- uses: wdzeng/[email protected]
with:
extension-id: jnjobgjobffgmgfnkpkjfjkkfhfikmfl
zip-path: PasswordGenerator-chrome.zip
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
publish-edge:
needs: build
if: ${{ github.event_name == 'release' || (github.event.inputs.edge == 'true' && contains(github.event.inputs.targets, 'chrome')) }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@main
with:
name: packed-chrome
- uses: wdzeng/[email protected]
with:
product-id: ${{ secrets.EDGE_PRODUCT_ID }}
zip-path: PasswordGenerator-chrome.zip
client-id: ${{ secrets.EDGE_CLIENT_ID }}
client-secret: ${{ secrets.EDGE_CLIENT_SECRET }}
access-token-url: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}
publish-firefox:
needs: build
if: ${{ github.event_name == 'release' || (github.event.inputs.firefox == 'true' && contains(github.event.inputs.targets, 'firefox')) }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@main
with:
name: packed-firefox
- uses: wdzeng/[email protected]
with:
addon-guid: ${{ secrets.FIREFOX_EXT_UUID }}
xpi-path: PasswordGenerator-firefox.zip
jwt-issuer: ${{ secrets.FIREFOX_API_KEY }}
jwt-secret: ${{ secrets.FIREFOX_CLIENT_SECRET }}