-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
135 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This is a workflow to generate the zip file and metadata.json for KiCAD PCM | ||
# https://gitlab.com/kicad/addons/metadata/-/merge_requests/14 | ||
|
||
name: KiCAD PCM packaging | ||
on: # yamllint disable-line rule:truthy | ||
release: | ||
branches: [master] | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
jobs: | ||
create_archive: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get latest tag | ||
uses: oprypin/find-latest-tag@v1 | ||
with: | ||
repository: zykrah/kicad-kle-placer | ||
releases-only: true | ||
id: latest-release | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Create archive | ||
run: sh ./PCM/create_pcm_archive.sh ${{ steps.latest-release.outputs.tag }} | ||
|
||
- name: Upload zip as asset to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./PCM/KiCAD-PCM-${{ steps.latest-release.outputs.tag }}.zip | ||
asset_name: KiCAD-PCM-${{ steps.latest-release.outputs.tag }}.zip | ||
overwrite: true | ||
tag: ${{ steps.latest-release.outputs.tag }} | ||
|
||
- name: Trigger custom kicad repo rebuild | ||
uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
workflow: Rebuild repository | ||
ref: refs/heads/main | ||
repo: zykrah/zykrah-kicad-repository | ||
token: ${{ secrets.PERSONAL_TOKEN }} | ||
inputs: '{ "VERSION": "${{env.VERSION}}", "DOWNLOAD_SHA256": "${{env.DOWNLOAD_SHA256}}", "DOWNLOAD_SIZE": "${{env.DOWNLOAD_SIZE}}", "DOWNLOAD_URL": "${{env.DOWNLOAD_URL}}", "INSTALL_SIZE": "${{env.INSTALL_SIZE}}" }' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
# heavily inspired by https://github.com/4ms/4ms-kicad-lib/blob/master/PCM/make_archive.sh | ||
|
||
VERSION=$1 | ||
|
||
echo "Clean up old files" | ||
rm -f PCM/*.zip | ||
rm -rf PCM/archive | ||
|
||
|
||
echo "Create folder structure for ZIP" | ||
mkdir -p PCM/archive/plugins | ||
mkdir -p PCM/archive/resources | ||
|
||
echo "Copy files to destination" | ||
cp VERSION PCM/archive/plugins | ||
cp *.py PCM/archive/plugins | ||
cp *.png PCM/archive/plugins | ||
cp settings.json PCM/archive/plugins | ||
cp -r icons PCM/archive/plugins | ||
cp PCM/icon.png PCM/archive/resources | ||
cp PCM/metadata.template.json PCM/archive/metadata.json | ||
|
||
echo "Write version info to file" | ||
echo $VERSION > PCM/archive/plugins/VERSION | ||
|
||
echo "Modify archive metadata.json" | ||
sed -i "s/VERSION_HERE/$VERSION/g" PCM/archive/metadata.json | ||
sed -i "s/\"kicad_version\": \"7.0\",/\"kicad_version\": \"7.0\"/g" PCM/archive/metadata.json | ||
sed -i "/SHA256_HERE/d" PCM/archive/metadata.json | ||
sed -i "/DOWNLOAD_SIZE_HERE/d" PCM/archive/metadata.json | ||
sed -i "/DOWNLOAD_URL_HERE/d" PCM/archive/metadata.json | ||
sed -i "/INSTALL_SIZE_HERE/d" PCM/archive/metadata.json | ||
|
||
echo "Zip PCM archive" | ||
cd PCM/archive | ||
zip -r ../KiCAD-PCM-$VERSION.zip . | ||
cd ../.. | ||
|
||
echo "Gather data for repo rebuild" | ||
echo VERSION=$VERSION >> $GITHUB_ENV | ||
echo DOWNLOAD_SHA256=$(shasum --algorithm 256 PCM/KiCAD-PCM-$VERSION.zip | xargs | cut -d' ' -f1) >> $GITHUB_ENV | ||
echo DOWNLOAD_SIZE=$(ls -l PCM/KiCAD-PCM-$VERSION.zip | xargs | cut -d' ' -f5) >> $GITHUB_ENV | ||
echo DOWNLOAD_URL="https:\/\/github.com\/zykrah\/kicad-kle-placer\/releases\/download\/$VERSION\/KiCAD-PCM-$VERSION.zip" >> $GITHUB_ENV | ||
echo INSTALL_SIZE=$(unzip -l PCM/KiCAD-PCM-$VERSION.zip | tail -1 | xargs | cut -d' ' -f1) >> $GITHUB_ENV |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"$schema": "https://go.kicad.org/pcm/schemas/v1", | ||
"name": "KiCAD KLE Placer", | ||
"description": "A plugin for KiCAD used to place switches based on a KLE.", | ||
"description_full": "This plugin allows you to automatically place footprints of your chosing from a generated KLE .json file.", | ||
"identifier": "com.github.zykrah.kicad-kle-placer", | ||
"type": "plugin", | ||
"author": { | ||
"name": "zykrah", | ||
"contact": { | ||
"github": "zykrah" | ||
} | ||
}, | ||
"maintainer": { | ||
"name": "zykrah", | ||
"contact": { | ||
"github": "zykrah" | ||
} | ||
}, | ||
"license": "MIT", | ||
"resources": { | ||
"homepage": "https://github.com/zykrah/kicad-kle-placer" | ||
}, | ||
"versions": [{ | ||
"version": "VERSION_HERE", | ||
"status": "testing", | ||
"kicad_version": "7.0", | ||
"download_sha256": "SHA256_HERE", | ||
"download_size": DOWNLOAD_SIZE_HERE, | ||
"download_url": "DOWNLOAD_URL_HERE", | ||
"install_size": INSTALL_SIZE_HERE | ||
}] | ||
} |
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
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