Skip to content

Commit 0845d9d

Browse files
committed
test workflow with PR
1 parent 7f0c5ef commit 0845d9d

File tree

2 files changed

+86
-5
lines changed

2 files changed

+86
-5
lines changed

.github/workflows/build_publish_copy_app.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
options:
1919
- 'true'
2020
- 'false'
21+
pull_request:
22+
branches:
23+
- master
2124

2225
permissions:
2326
contents: write
@@ -40,18 +43,18 @@ jobs:
4043
4144
- name: Login to platform
4245
run: |
43-
if [[ ${{ inputs.is-staging }} == "true" ]]; then
46+
# if [[ ${{ inputs.is-staging }} == "true" ]]; then
4447
staging_param="--staging"
45-
fi
48+
# fi
4649
token="${{ inputs.is-staging == 'true' && secrets.DX_STAGING_ROBOT_TOKEN || secrets.DX_PROD_RELEASE_TOKEN }}"
4750

4851
dx login --token $token --noprojects $staging_param
4952

5053
- name: Build and publish 'dxCompiler Copy File' app
5154
run: |
52-
if [[ ${{ inputs.publish-app }} == "true" ]]; then
53-
publish_param="--publish"
54-
fi
55+
# if [[ ${{ inputs.publish-app }} == "true" ]]; then
56+
# publish_param="--publish"
57+
# fi
5558

5659
cd scripts/dxcompiler_copy
5760
dx build --app $publish_param dxwdl_copy
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash -e
2+
3+
# Global variables
4+
top_dir=""
5+
token=""
6+
should_publish_app=""
7+
8+
# https://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself
9+
# Get the source directory of the distribution
10+
function get_top_dir {
11+
SCRIPT=$(realpath "$0")
12+
SCRIPTPATH=$(dirname "$SCRIPT")
13+
top_dir=$(realpath "$SCRIPTPATH/..")
14+
echo "The dxCompiler top directory is: $top_dir"
15+
}
16+
17+
function build {
18+
# build the release on staging
19+
echo "building staging release"
20+
dx login --staging --token $staging_token --noprojects
21+
$top_dir/scripts/build_release.py --multi-region $build_flags
22+
23+
## test that it actually works
24+
echo "running multi region tests on staging"
25+
$top_dir/scripts/multi_region_tests.py
26+
#$top_dir/scripts/proxy_test.py
27+
28+
echo "leave staging"
29+
dx clearenv
30+
31+
## build on production
32+
echo "building on production"
33+
dx login --token $production_token --noprojects
34+
$top_dir/scripts/build_release.py --multi-region $build_flags
35+
}
36+
37+
function parse_cmd_line {
38+
while [[ $# -ge 1 ]]
39+
do
40+
case "$1" in
41+
--token)
42+
token=$2
43+
shift
44+
;;
45+
--publish-app)
46+
should_publish_app=$2
47+
shift
48+
;;
49+
*)
50+
echo "unknown argument $1"
51+
echo "arguments: "
52+
echo " --token: dx auth token"
53+
echo " --should_publish_app: either 'true' or 'false'"
54+
exit 1
55+
esac
56+
shift
57+
done
58+
59+
if [[ $token == "" ]]; then
60+
echo "dx token is missing"
61+
exit 1
62+
fi
63+
64+
if [[ $should_publish_app == "" ]]; then
65+
echo "should_publish_app is missing"
66+
exit 1
67+
fi
68+
69+
if [[ $should_publish_app != "true" && $should_publish_app != "false" ]]; then
70+
echo "should_publish_app must be 'true' or 'false'"
71+
exit 1
72+
fi
73+
}
74+
75+
# main program
76+
parse_cmd_line $@
77+
get_top_dir
78+
build

0 commit comments

Comments
 (0)