Skip to content

Commit

Permalink
Revert "国际化、日本及中国大陆地区询价下单 (#2) (#4)"
Browse files Browse the repository at this point in the history
This reverts commit ad027e7.
  • Loading branch information
SYSUeric66 committed Oct 26, 2023
1 parent ad027e7 commit c5e0739
Show file tree
Hide file tree
Showing 100 changed files with 1,591 additions and 13,600 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/kicad-pcm-simple.bak

This file was deleted.

10 changes: 2 additions & 8 deletions .github/workflows/kicad-pcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# 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 and trigger kicad-addone
on: # yamllint disable-line rule:truthy
name: KiCAD PCM packaging
on: # yamllint disable-line rule:truthy
release:
branches: [main]
types:
Expand All @@ -24,12 +24,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup env
run: pip3 install -r ./requirements-dev.txt

- name: Unittest
run: pytest

- name: Create archive
run: sh ./PCM/create_pcm_archive.sh ${{ steps.latest-release.outputs.tag }}

Expand Down
151 changes: 0 additions & 151 deletions .gitignore

This file was deleted.

11 changes: 0 additions & 11 deletions .pre-commit-config.yaml

This file was deleted.

42 changes: 0 additions & 42 deletions DEVELOPMENT.md

This file was deleted.

File renamed without changes
71 changes: 28 additions & 43 deletions PCM/create_pcm_archive.sh
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

Loading

0 comments on commit c5e0739

Please sign in to comment.