Skip to content

Commit

Permalink
MNT: Update test_tag
Browse files Browse the repository at this point in the history
Run from anywhere, use meaningful commit/tag messages, do not push
automatically
  • Loading branch information
effigies committed Aug 25, 2022
1 parent 4ad77da commit b9e526f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions scripts/test_tag
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/usr/bin/env bash

# Execute this script from its containing directory to push to a new unique testing tag.
# Execute this script from anywhere in the repository to push to a new unique testing tag.
# This is a script which automates creation and pushing of unique tags for github actions.
# It is particularly useful when debugging the upload hooks for pypi.
# The workflow for that is to edit `.github/workflows/schemacode_ci.yml` and add a secondary branch name to the `on` section right after master.
# This will allow you to keep pushing to the branch as if it were master and unix-time tagged archives being uploaded to test.pypi.

VERSION_FILE="src/schema/SCHEMA_VERSION"
EPOCH="$(date +%s)"

pushd ..
export MY_BIDS_DATE="$(date +%s)"
REAL_VERSION=$(cat "${VERSION_FILE}")
DUMMY_VERSION="0.0.${MY_BIDS_DATE}-dev"
echo "${DUMMY_VERSION}" > "${VERSION_FILE}"
git commit -a -m "debug"
git tag -a "schema-$DUMMY_VERSION" -m "debug"
git push origin
git push origin "schema-$DUMMY_VERSION"
echo "${REAL_VERSION}" > "${VERSION_FILE}"
popd
unset MY_BIDS_DATE
GIT_DIR=$( git rev-parse --git-dir )
REPO_ROOT=$( ls -d ${GIT_DIR%.git} )

VERSION_FILE="$REPO_ROOT/src/schema/SCHEMA_VERSION"

REAL_VERSION=$(cat "${VERSION_FILE}")
DUMMY_VERSION="0.0.${EPOCH}-dev"

echo "${DUMMY_VERSION}" > "${VERSION_FILE}"
git commit -a -m "Test release $DUMMY_VERSION"
git tag -a "schema-$DUMMY_VERSION" -m "Test release $DUMMY_VERSION"

echo "${REAL_VERSION}" > "${VERSION_FILE}"

0 comments on commit b9e526f

Please sign in to comment.