Skip to content

Package and Release

Package and Release #6

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: List directory contents before creating CRX
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: Create CRX file
run: crx3 --crx dist/isnss-extractor.crx --zip dist/isnss-extractor.zip --key private.pem --o extension .
- 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.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