2021-12-17 17:21:31 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
|
|
|
|
echo "It's a PR"
|
|
|
|
|
|
|
|
export SHOULD_DEPLOY="no"
|
|
|
|
elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
|
|
|
|
echo "It's a Push"
|
|
|
|
|
|
|
|
export SHOULD_DEPLOY="no"
|
|
|
|
else
|
|
|
|
echo "It's a cron"
|
|
|
|
|
|
|
|
sudo curl -sS --unix-socket /run/snapd.socket http://localhost/v2/find\?q\=codium > snap_latest.json
|
2021-12-17 18:37:49 -05:00
|
|
|
SNAP_VERSION=$(jq -r '.result|map(select(.id == "lIZWXTqmo6LFSts5Cgk2VPlNwtysZAeH"))|last.version' snap_latest.json)
|
2021-12-17 17:21:31 -05:00
|
|
|
echo "Snap version: ${SNAP_VERSION}"
|
|
|
|
|
|
|
|
wget --quiet https://api.github.com/repos/VSCodium/vscodium/releases -O gh_latest.json
|
|
|
|
GH_VERSION=$(jq -r 'sort_by(.tag_name)|last.tag_name' gh_latest.json)
|
|
|
|
echo "GH version: ${GH_VERSION}"
|
|
|
|
|
2021-12-17 19:24:22 -05:00
|
|
|
rm -f snap_latest.json gh_latest.json
|
|
|
|
|
2021-12-17 17:21:31 -05:00
|
|
|
if [[ "${SNAP_VERSION}" == "${GH_VERSION}" ]]; then
|
|
|
|
export SHOULD_DEPLOY="no"
|
|
|
|
else
|
|
|
|
export SHOULD_DEPLOY="yes"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $GITHUB_ENV ]]; then
|
|
|
|
echo "SHOULD_DEPLOY=$SHOULD_DEPLOY" >> $GITHUB_ENV
|
|
|
|
fi
|