#!/bin/bash

git config user.email "jonathan.franco.2103@gmail.com"
git config user.name "CI"
git remote add gitlab_origin https://oauth2:"${PUBLISH_TOKEN}"@gitlab.com/rglw/public/base/rglw_bumper.git

cargo install toml-cli

PACKAGE_VERSION=$(toml get Cargo.toml package.version --raw)

git tag -a "${PACKAGE_VERSION}" -m "Version ${PACKAGE_VERSION}"

git push gitlab_origin --tags

CARGO_REGISTRY_TOKEN=${1} cargo publish