Add New Plugin Version #8
This file contains hidden or 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: Add New Plugin Version | |
on: | |
workflow_dispatch: | |
inputs: | |
identifier: | |
description: 'Plugin identifier (e.g. com.github.username.plugin)' | |
required: true | |
type: string | |
version: | |
description: 'Version of the plugin (e.g. 1.0.0)' | |
required: true | |
type: string | |
status: | |
description: 'Status of the version (stable, testing, development, deprecated)' | |
required: true | |
type: choice | |
options: | |
- stable | |
- testing | |
- development | |
- deprecated | |
default: 'stable' | |
kicad_version: | |
description: 'Minimum KiCad version required (e.g. 8.0)' | |
required: true | |
type: string | |
download_url: | |
description: 'URL to download the plugin archive' | |
required: true | |
type: string | |
permissions: | |
contents: write | |
jobs: | |
add-plugin-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Process plugin version | |
id: update_plugin | |
run: | | |
cd $GITHUB_WORKSPACE | |
python scripts/add_plugin_version.py \ | |
"${{ github.event.inputs.identifier }}" \ | |
"${{ github.event.inputs.version }}" \ | |
"${{ github.event.inputs.status }}" \ | |
"${{ github.event.inputs.kicad_version }}" \ | |
"${{ github.event.inputs.download_url }}" | |
- name: Check for changes | |
id: git-check | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add packages.json repository.json | |
git diff --staged --quiet || echo "changes=true" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
if: steps.git-check.outputs.changes == 'true' | |
run: | | |
git commit -m "Add version ${{ github.event.inputs.version }} for ${{ github.event.inputs.identifier }}" | |
git push |