sort_Hangul_Rime_Files_output #4
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_Hangul_Rime_Files_output | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
ref: 'main' | |
- uses: montudor/action-zip@v1 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- run: | | |
python sort_Hangul_Rime_Files.py | |
BASEDIR=`pwd` | |
FOLDER=`find ${BASEDIR} -name "電腦RIME*" -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 "電腦RIME*" "電腦RIME.zip" | |
# copy "電腦RIME*" "注音洋蔥純注音版*" | |
# remove_dir "ocm_20*" | |
copy_dir "電腦RIME*" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
path: | | |
output/* | |