Skip to content

sort_rime_output

sort_rime_output #80

name: sort_rime_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_rime_file.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@v3
with:
if-no-files-found: error
path: |
output/*