mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 19:57:04 +05:30
scripts: return to monke
I don't like bash but turns out I dislike Python more This reverts commit2628bfc2cd
,d77fa13903
and69f63cced4
.
This commit is contained in:
parent
892d68581d
commit
591c68a6e4
8 changed files with 90 additions and 218 deletions
43
scripts/deploy-snapshot.sh
Executable file
43
scripts/deploy-snapshot.sh
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
NIGHTLY_TAG="nightly"
|
||||
CURRENT_REV="$(git rev-parse --short HEAD)"
|
||||
ASSET_DIRECTORY="${GITHUB_WORKSPACE:?}/android/apk"
|
||||
|
||||
function overwrite_local_tag() {
|
||||
git tag -f "${NIGHTLY_TAG}"
|
||||
}
|
||||
|
||||
function overwrite_remote_tag() {
|
||||
git push -f origin "${NIGHTLY_TAG}"
|
||||
}
|
||||
|
||||
function has_release() {
|
||||
gh release view "${NIGHTLY_TAG}" &>/dev/null
|
||||
echo "$?"
|
||||
}
|
||||
|
||||
function delete_release() {
|
||||
gh release delete --yes "${NIGHTLY_TAG}"
|
||||
}
|
||||
|
||||
function create_release() {
|
||||
local CHANGELOG_FILE
|
||||
CHANGELOG_FILE="$(mktemp)"
|
||||
echo "Latest release for Claw from revision ${CURRENT_REV}" | tee "${CHANGELOG_FILE}"
|
||||
pushd "${ASSET_DIRECTORY}" || return
|
||||
gh release create --prerelease --title "Latest snapshot build" --notes-file "${CHANGELOG_FILE}" "${NIGHTLY_TAG}" ./*.apk
|
||||
popd || return
|
||||
}
|
||||
|
||||
overwrite_local_tag
|
||||
|
||||
if [[ "$(has_release)" -eq 0 ]]; then
|
||||
delete_release
|
||||
fi
|
||||
|
||||
overwrite_remote_tag
|
||||
|
||||
create_release
|
Loading…
Add table
Add a link
Reference in a new issue