Skip to content

Package and Release #14

Package and Release

Package and Release #14

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: 'lts/*'
- name: Install dependencies
run: npm install chrome-extension-builder
- 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: Package Chrome extension
run: npx chrome-extension-builder --key private.pem --output dist/isnss-extractor.crx .
shell: bash
- 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: Release 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