Skip to content

Package and Release v2 #3

Package and Release v2

Package and Release v2 #3

name: Package and Release v2
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: 'lts/*'
- name: Install dependencies
run: npm install -g web-ext
- name: Create private key file
run: echo "${{ secrets.PRIVATE_KEY }}" > private.pem
- name: List directory contents before creating ZIP
run: ls -alR
- name: Verify manifest.json exists
run: test -f ./manifest.json && echo "manifest.json found" || echo "manifest.json not found"
- name: Ensure dist directory exists
run: mkdir -p dist
- name: Zip the extension
run: zip -r dist/isnss-extractor.zip . -x \*.git\* \*.github\* \*dist\*
- name: Convert Zip to CRX
run: |
openssl sha1 -sha1 -binary -out key.der private.pem
openssl rsa -pubout -outform DER -in private.pem -out public.der
echo -en '\x43\x72\x32\x34' > crmagic.bin
openssl dgst -sha256 -binary < dist/isnss-extractor.zip > zip.sig
cat crmagic.bin key.der public.der zip.sig dist/isnss-extractor.zip > dist/isnss-extractor.crx
- name: List directory contents after creating CRX
run: ls -alR dist
- 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.PAT_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: v${{ env.VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_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