-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit ad027e7.
- Loading branch information
1 parent
ad027e7
commit c5e0739
Showing
100 changed files
with
1,591 additions
and
13,600 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes
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 |
---|---|---|
@@ -1,61 +1,46 @@ | ||
#!/bin/sh | ||
|
||
# heavily inspired by https://github.com/4ms/4ms-kicad-lib/blob/master/PCM/make_archive.sh | ||
# inspired by https://github.com/Bouni/kicad-jlcpcb-tools/blob/main/PCM/create_pcm_archive.sh | ||
|
||
VERSION=$1 | ||
PRJECT_ROOT=`pwd` | ||
PCM_ROOT="$PRJECT_ROOT/PCM" | ||
ACHIEVE_PATH="$PRJECT_ROOT/PCM/archive" | ||
PLUGIN_PATH="$ACHIEVE_PATH/plugins" | ||
RESOURCE_PATH="$ACHIEVE_PATH/resources" | ||
OUTPUT_ZIP_PATH="$PCM_ROOT/KiCAD-PCM-$VERSION.zip" | ||
|
||
|
||
|
||
echo "Clean up old files" | ||
rm -f $PCM_ROOT/*.zip | ||
rm -rf $PLUGIN_PATH | ||
rm -f PCM/*.zip | ||
rm -rf PCM/archive | ||
|
||
|
||
TRANSLATION_PATH="$PRJECT_ROOT/kicad_amf_plugin/language/geni18n.py" | ||
echo "Excuting the translation script : $TRANSLATION_PATH" | ||
python3 $TRANSLATION_PATH | ||
|
||
echo "Create folder structure for ZIP" | ||
mkdir -p $PLUGIN_PATH | ||
mkdir -p $RESOURCE_PATH | ||
|
||
echo "Copy plugin to destination" | ||
mkdir -p PCM/archive/plugins | ||
mkdir -p PCM/archive/resources | ||
|
||
for i in __init__.py __main__.py kicad_amf_plugin | ||
do cp -r $i $PLUGIN_PATH | ||
done | ||
echo "Copy files to destination" | ||
cp VERSION PCM/archive/plugins | ||
cp *.py PCM/archive/plugins | ||
cp *.png PCM/archive/plugins | ||
cp config.json PCM/archive/plugins | ||
cp PCM/icon.png PCM/archive/resources | ||
cp PCM/metadata.template.json PCM/archive/metadata.json | ||
|
||
for i in `find $PLUGIN_PATH -iname __pycache__` ; do rm -rf $i ; done | ||
|
||
echo "Write version to achieve" | ||
echo $VERSION > $PLUGIN_PATH/VERSION | ||
|
||
echo "Copy resource to destination" | ||
cp $PCM_ROOT/icon.png $RESOURCE_PATH | ||
META_DATA_PATH=$ACHIEVE_PATH/metadata.json | ||
cp $PCM_ROOT/metadata.template.json $META_DATA_PATH | ||
echo "Write version info to file" | ||
echo $VERSION > PCM/archive/plugins/VERSION | ||
|
||
echo "Modify archive metadata.json" | ||
sed -i "s/VERSION_HERE/$VERSION/g" $META_DATA_PATH | ||
sed -i "s/\"kicad_version\": \"6.0\",/\"kicad_version\": \"6.0\"/g" $META_DATA_PATH | ||
sed -i "/SHA256_HERE/d" $META_DATA_PATH | ||
sed -i "/DOWNLOAD_SIZE_HERE/d" $META_DATA_PATH | ||
sed -i "/DOWNLOAD_URL_HERE/d" $META_DATA_PATH | ||
sed -i "/INSTALL_SIZE_HERE/d" $META_DATA_PATH | ||
sed -i "s/VERSION_HERE/$VERSION/g" PCM/archive/metadata.json | ||
sed -i "s/\"kicad_version\": \"6.0\",/\"kicad_version\": \"6.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 $ACHIEVE_PATH | ||
zip -r $OUTPUT_ZIP_PATH . | ||
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 $OUTPUT_ZIP_PATH | xargs | cut -d' ' -f1) >> $GITHUB_ENV | ||
echo DOWNLOAD_SIZE=$(ls -l $OUTPUT_ZIP_PATH | xargs | cut -d' ' -f5) >> $GITHUB_ENV | ||
echo DOWNLOAD_URL="https:\/\/github.com\/Bouni\/kicad-jlcpcb-tools\/releases\/download\/$VERSION\/KiCAD-PCM-$VERSION.zip" >> $GITHUB_ENV | ||
echo INSTALL_SIZE=$(unzip -l $OUTPUT_ZIP_PATH | tail -1 | xargs | cut -d' ' -f1) >> $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\/SYSUeric66\/kicad-amf-plugin\/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 | ||
|
Oops, something went wrong.