update actions

pull/14/head
fengyuecanzhu 3 years ago
parent ab191238c5
commit 94b2860f2f
  1. 56
      .github/workflows/reader.yml

@ -38,37 +38,37 @@ jobs:
name: FYReader-apk name: FYReader-apk
path: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk path: ${{ github.workspace }}/app/build/outputs/apk/release/*.apk
- name: Prepare config - name: Prepare config
id: config id: config
run: | run: |
echo "获取是否需要创建release并获取配置" echo "获取是否需要创建release并获取配置"
source ${{ github.workspace }}/app/version_code.properties source ${{ github.workspace }}/app/version_code.properties
version=$VERSION_CODE version=$VERSION_CODE
hun=$(expr ${version} / 100) hun=$(expr ${version} / 100)
ten=$(expr ${version} / 10) ten=$(expr ${version} / 10)
ten=$(expr ${ten} % 10) ten=$(expr ${ten} % 10)
one=$(expr ${version} % 10) one=$(expr ${version} % 10)
versionN=$hun.$ten.$one versionN=$hun.$ten.$one
echo ::set-output name=need_create_release::"$NEED_CREATE_RELEASE" echo ::set-output name=need_create_release::"$NEED_CREATE_RELEASE"
echo ::set-output name=version_name::"$versionN" echo ::set-output name=version_name::"$versionN"
if [[ $NEED_CREATE_RELEASE == "true" ]];then if [[ $NEED_CREATE_RELEASE == "true" ]];then
echo ::set-env name=LANZOU_FOLDER_ID::"1608604" echo ::set-env name=LANZOU_FOLDER_ID::"1608604"
echo ::set-env name=LANZOU_SHARE_URL::"https://fycz.lanzoui.com/b00ngso7e" echo ::set-env name=LANZOU_SHARE_URL::"https://fycz.lanzoui.com/b00ngso7e"
fi fi
path="$GITHUB_WORKSPACE/app/build/outputs/apk/release" path="$GITHUB_WORKSPACE/app/build/outputs/apk/release"
files=$(ls $path) files=$(ls $path)
for f in $files for f in $files
do do
if [[ $f == *"apk" ]]; then if [[ $f == *"apk" ]]; then
file=$f file=$f
echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 文件:$file" echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 文件:$file"
break break
fi fi
done done
echo ::set-output name=file_name::"$file" echo ::set-output name=file_name::"$file"
echo ::set-output name=file_path::"$path/$file" echo ::set-output name=file_path::"$path/$file"
- name: Create Release - name: Create Release
id: create_release id: create_release
if: ${{ steps.config.outputs.need_create_release == "true" }} if: ${{ steps.config.outputs.need_create_release == "true" }}

Loading…
Cancel
Save