Skip to content

Commit f059020

Browse files
committed
[travis] also publish the snap on the snap store
1 parent f6bebfc commit f059020

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

.travis.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ env:
2424
before_install:
2525
# determine build identifier
2626
- '[ -n "${TRAVIS_PULL_REQUEST}" ] && export MULTIPASS_BUILD_ID="pr${TRAVIS_PULL_REQUEST}"'
27+
# extract credentials
28+
- openssl aes-256-cbc -K $encrypted_1b80fb3c7803_key -iv $encrypted_1b80fb3c7803_iv
29+
-in tools/bot-data.tar.xz.enc -out tools/bot-data.tar.xz -d
30+
- tar --extract --xz --file tools/bot-data.tar.xz --directory ${HOME}
2731

2832
install:
2933
- sudo apt remove --purge --assume-yes lxd lxd-client
@@ -65,10 +69,15 @@ jobs:
6569
- sg lxd -c '/snap/bin/snapcraft --use-lxd'
6670
- /snap/bin/review-tools.snap-review --allow-classic *.snap
6771
after_success:
68-
- [ -z "${TRAVIS_PULL_REQUEST}" ] && exit
69-
- BUILD_URL=$( curl --fail --max-time 600 --upload-file *.snap https://transfer.sh/ )
70-
&& echo ${BUILD_URL}
71-
&& ./tools/report-build.py Snap ${BUILD_URL}
72+
- '[ -z "${TRAVIS_PULL_REQUEST}" ] && exit'
73+
- BUILDS=()
74+
- snapcraft login --with ${HOME}/snap-login
75+
- snapcraft push multipass_*.snap --release edge/${MULTIPASS_BUILD_ID}
76+
&& BUILDS+="`snap refresh multipass --channel edge/${MULTIPASS_BUILD_ID}`"
77+
- CURL_OUTPUT=$( curl --fail --max-time 600 --upload-file *.snap https://transfer.sh/ )
78+
&& BUILDS+="[$( basename ${CURL_OUTPUT} )](${CURL_OUTPUT})";
79+
echo ${CURL_OUTPUT}
80+
- ./tools/report-build.py Snap "${BUILDS[@]}"
7281

7382
- env: BUILD_TYPE=Clang
7483
before_script: *before_snapcraft
@@ -110,10 +119,7 @@ jobs:
110119
submodules: false
111120
sudo: false
112121
addons: ~
113-
install:
114-
- openssl aes-256-cbc -K $encrypted_8d49841daf21_key -iv $encrypted_8d49841daf21_iv
115-
-in tools/bot-data.tar.xz.enc -out tools/bot-data.tar.xz -d
116-
- tar --extract --xz --file tools/bot-data.tar.xz --directory ${HOME}
122+
install: ~
117123
script:
118124
- |
119125
if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
@@ -125,10 +131,10 @@ jobs:
125131
ssh -q -p ${MAC_PORT} ${MAC_USERHOST} multipass-build/build-in-snapshot.sh public "${REF}" "${ARTIFACTS_DIR}" "${MULTIPASS_BUILD_ID}"
126132
scp -P ${MAC_PORT} ${MAC_USERHOST}:${ARTIFACTS_DIR}/*.pkg .
127133
after_success:
128-
- [ -z "${TRAVIS_PULL_REQUEST}" ] && exit
129-
- BUILD_URL=$( curl --fail --max-time 600 --upload-file *.pkg https://transfer.sh/ )
130-
&& echo ${BUILD_URL}
131-
&& ./tools/report-build.py macOS ${BUILD_URL}
134+
- '[ -z "${TRAVIS_PULL_REQUEST}" ] && exit'
135+
- CURL_OUTPUT=$( curl --fail --max-time 600 --upload-file *.pkg https://transfer.sh/ )
136+
&& ./tools/report-build.py macOS "[$( basename ${CURL_OUTPUT} )](${CURL_OUTPUT})";
137+
echo ${CURL_OUTPUT}
132138
after_script: ~
133139
after_failure: ~
134140
cache: ~

tools/bot-data.tar.xz.enc

672 Bytes
Binary file not shown.

tools/report-build.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ class MinimizeComment(GitHubQLQuery):
115115

116116
def main():
117117
build_id = sys.argv[1]
118-
build_url = sys.argv[2]
119-
comment_body = ["{} build available: [{}]({})".format(
120-
build_id, build_url.split("/")[-1], build_url)]
118+
comment_body = " or ".join(sys.argv[2:])
121119

122120
events_d = GetEvents().run({
123121
"owner": os.environ["TRAVIS_REPO_SLUG"].split("/")[0],

0 commit comments

Comments
 (0)