-
Notifications
You must be signed in to change notification settings - Fork 127
/
action_setenv.sh
45 lines (38 loc) · 1.37 KB
/
action_setenv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
function set_env() { echo "$1=$2" >> $GITHUB_ENV; }
APP_NAME="legado"
APP_GIT_URL="https://github.com/gedoor/legado.git"
APP_SUFFIX="A"
APP_CHANNEL="App"
if [ "$SECRETS_ENABLE" == "true" ] && [ -n "$SECRETS_APP_NAME" ] && [ -n "$SECRETS_GIT_URL" ] && [ "$REPO_ACTOR" == "$REPO_OWNER" ]; then
APP_NAME=$SECRETS_APP_NAME
APP_GIT_URL=$SECRETS_GIT_URL
fi
if [ -n "$SECRETS_SUFFIX" ] && [ "$REPO_ACTOR" == "$REPO_OWNER" ]; then
APP_SUFFIX=$SECRETS_SUFFIX
fi
APP_LAUNCH_NAME="阅读.$APP_SUFFIX"
if [ -n "$SECRETS_LAUNCH_NAME" ] && [ "$REPO_ACTOR" = "$REPO_OWNER" ]; then
APP_LAUNCH_NAME=$SECRETS_LAUNCH_NAME
fi
if [ -n "$SECRETS_CHANNEL" ]; then
APP_CHANNEL=$SECRETS_CHANNEL
fi
APP_WORKSPACE="/opt/$APP_NAME"
APP_LATEST_TAG='latest'
APP_UPLOAD_NAME="$APP_NAME-$APP_LATEST_TAG"
APP_UPLOAD="$APP_WORKSPACE/app/build/outputs/apk/app/release"
set_env APP_NAME $APP_NAME
set_env APP_CHANNEL $APP_CHANNEL
set_env APP_LAUNCH_NAME $APP_LAUNCH_NAME
set_env APP_WORKSPACE $APP_WORKSPACE
set_env APP_SUFFIX $APP_SUFFIX
set_env APP_GIT_URL $APP_GIT_URL
set_env APP_UPLOAD_NAME $APP_UPLOAD_NAME
set_env APP_UPLOAD $APP_UPLOAD
set_env REPO_ACTOR $REPO_ACTOR
set_env REPO_OWNER $REPO_OWNER
set_env SECRETS_ENABLE $SECRETS_ENABLE
set_env SECRETS_MINIFY $SECRETS_MINIFY
set_env SECRETS_TAG $SECRETS_TAG
set_env SECRETS_RENAME $SECRETS_RENAME