sort_trime_output #47
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
name: sort_trime_output | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
ref: 'main' | |
- uses: montudor/action-zip@v1 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- run: | | |
python sort_trime_file.py | |
BASEDIR=`pwd` | |
FOLDER=`find ${BASEDIR} -name "洋蔥手機同文方案*" -type d` | |
OUTPUT="${BASEDIR}/output" | |
mkdir -p $OUTPUT | |
function create_zip() { | |
SOURCE=`find ${FOLDER} -name "$1" -type d` | |
cd $SOURCE | |
zip -qq -r $OUTPUT/$2 ./ | |
} | |
function copy() { | |
SOURCE=`find ${FOLDER} -name "$1" -type d` | |
TARGET=`find ${SOURCE} -name "$2" -type f` | |
cp $TARGET $OUTPUT | |
} | |
function copy_dir() { | |
SOURCE=`find ${FOLDER} -name "$1" -type d` | |
cp -r $SOURCE $OUTPUT | |
} | |
function remove_dir() { | |
SOURCE=`find ${FOLDER} -name "$1" -type d` | |
rm -r $SOURCE | |
} | |
# create_zip "洋蔥手機同文方案*" "洋蔥手機同文方案.zip" | |
# copy "洋蔥手機同文方案*" "洋蔥同文注音純注音版*" | |
remove_dir "洋蔥手機蝦_20*" | |
copy_dir "洋蔥手機同文方案*" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
path: | | |
output/* | |