-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
101 lines (94 loc) · 3.4 KB
/
action.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: 'Upload to Waldo'
description: |
Uploads your build (`.app`, `.ipa`, or `.apk`) to Waldo.
inputs:
build_path:
description: >
The path to your `.app`, `.ipa`, or `.apk` build. Typically the build
path is generated by a previous build action in your workflow.
required: true
upload_token:
description: >
The upload token associated with your app. Each application registered in
Waldo is associated with a unique upload token.
required: true
variant_name:
description: >
An optional variant name. This is an arbitrary string to associate with
this build.
required: false
default: ''
git_commit:
description: >
The originating git commit hash. This is the hash of the originating git
commit (also known as the “git SHA”) for this build. If omitted, Waldo
attempts to infer the git commit from the CI provider (if any) or from
the current git repository (if accessible).
required: false
default: ''
git_branch:
description: >
The originating git commit branch name. This is the branch name (if any)
of the originating git commit for this build. If omitted, Waldo attempts
to infer the git branch name from the CI provider (if any) or from the
current git repository (if accessible).
required: false
default: ''
is_debug_mode:
description: >
If this mode is enabled, additional debug information is printed.
required: false
default: false
bin_path:
description: >
The path to install Waldo CLI into for internal use.
required: false
default: /usr/local/bin
outputs:
build_id:
description: >
A unique identifier for the build that you just uploaded. Empty if the
upload failed.
value: ${{ fromJSON(steps.metadata.outputs.json).appVersionID }}
runs:
using: composite
steps:
- run: |
if [ ! -e ${WALDO_CLI_BIN}/waldo ]; then
bash -c "$(curl -fLs https://github.com/waldoapp/waldo-go-cli/raw/master/install-waldo.sh)"
fi
build_path=${{ inputs.build_path }}
git_branch=${{ inputs.git_branch }}
git_commit=${{ inputs.git_commit }}
upload_token=${{ inputs.upload_token }}
variant_name=${{ inputs.variant_name }}
verbose=${{ inputs.is_debug_mode }}
extra_options=""
if [[ -n $variant_name ]]; then
extra_options="${extra_options} --variant_name ${variant_name}"
fi
if [[ -n $git_commit ]]; then
extra_options="${extra_options} --git_commit ${git_commit}"
fi
if [[ -n $git_branch ]]; then
extra_options="${extra_options} --git_branch ${git_branch}"
fi
if [[ $verbose == "true" ]]; then
extra_options="${extra_options} --verbose"
fi
${WALDO_CLI_BIN}/waldo upload "$build_path" --upload_token "$upload_token" ${extra_options} | tee "$TMP_OUT"
env:
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
TMP_OUT: ${{ runner.temp }}/upload.out
WALDO_CLI_BIN: ${{ inputs.bin_path }}
WALDO_WRAPPER_NAME_OVERRIDE: 'Waldo GitHub Action'
WALDO_WRAPPER_VERSION_OVERRIDE: 3.0.0
shell: bash
- run: echo "json=$(tail -n 1 "$TMP_OUT")" >> "$GITHUB_OUTPUT"
id: metadata
env:
TMP_OUT: ${{ runner.temp }}/upload.out
shell: bash
branding:
icon: upload-cloud
color: blue