Fixed reference issues to staging
function set-versions() {
local version=$1
- set -x
sed "s/^__version__.*/__version__ = \"${version}\"/g" -i hikari/__init__.py
sed "0,/^version.*$/s//version = \"${version}\"/g" -i pyproject.toml
sed "0,/^version.*$/s//version = \"${version}\"/g" -i docs/conf.py
- set +x
}
function deploy-to-pypi() {
- set -x
poetry build
poetry publish --username="$PYPI_USER" --password="$PYPI_PASS" --repository=hikarirepo
- set +x
}
function notify() {
- set -x
local version=$1
python tasks/notify.py "${version}" "hikari.core"
- set +x
}
function deploy-to-gitlab() {
- set -x
- set -e
local repo
- local current_version=$1
- local next_version=$2
+ local old_version=$1
+ local current_version=$2
# Init SSH auth.
eval "$(ssh-agent -s)"
@@ -44,25 +36,25 @@ function deploy-to-gitlab() {
git config user.name "Hikari CI"
git config user.email "nekoka.tt@outlook.com"
git add pyproject.toml docs/conf.py hikari/core/__init__.py
- git commit -am "Deployed $current_version, will update to $next_version [skip ci]"
- git tag "$current_version"
+ git commit -am "Deployed $old_version, will update to $current_version [skip ci]"
+ git tag "$old_version"
git push origin master
- git push origin "$current_version"
+ git push origin "$old_version"
git checkout staging
- git merge -X ours origin/master -m "Deployed $current_version, updating staging to match master on $next_version [skip ci]" || true
+ git merge -X ours origin/master -m "Deployed $old_version, updating staging to match master on $current_version [skip ci]" || true
git push origin staging || true
- set +e
- set +x
}
function do-deployment() {
set -x
+ local old_version
local current_version
- local next_version
+ git fetch -ap
git checkout -f "${CI_COMMIT_REF_NAME}"
- current_version=$(grep -oP "^version\s*=\s*\"\K[^\"]*" pyproject.toml)
- next_version=$(python tasks/make-version-string.py "$CI_COMMIT_REF_NAME")
+
+ old_version=$(grep -oP "^version\s*=\s*\"\K[^\"]*" pyproject.toml)
+ current_version=$(python tasks/make-version-string.py "$CI_COMMIT_REF_NAME")
poetry config repositories.hikarirepo "$PYPI_REPO"
@@ -74,7 +66,7 @@ function do-deployment() {
git stash; git checkout staging -f; git checkout master -f; git stash pop
# Push to GitLab and update both master and staging.
- deploy-to-gitlab "$current_version" "$next_version"
+ deploy-to-gitlab "$old_version" "$current_version"
deploy-to-pypi
# Trigger Hikari deployment in main umbrella repo.
echo "Triggering hikari package rebuild"
@@ -89,6 +81,6 @@ function do-deployment() {
;;
esac
- notify "$current_version"
+ notify "$old_version"
set +x
}
