Package and Release #2
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: Package and Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: npm install -g crx3 | |
- name: Create private key file | |
run: echo "${{ secrets.PRIVATE_KEY }}" > private.pem | |
- name: Create CRX file | |
run: | | |
mkdir -p dist | |
crx3 --crx dist/isnss-extractor.crx --zip dist/isnss-extractor.zip --key private.pem --o extension ./ | |
- name: Get version from manifest | |
id: get_version | |
run: echo "VERSION=$(jq -r '.version' manifest.json)" >> $GITHUB_ENV | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.VERSION }} | |
release_name: Release v${{ env.VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/isnss-extractor.crx | |
asset_name: isnss-extractor.crx | |
asset_content_type: application/x-chrome-extension |