Skip to content

ci(main-workflow): add steps to update partial version reference tags - #1034

Merged
codejedi365 merged 1 commit into
python-semantic-release:masterfrom
codejedi365:ci/add-partial-version-reference-tags
Sep 28, 2024
Merged

codejedi365 merged 1 commit into
python-semantic-release:masterfrom
codejedi365:ci/add-partial-version-reference-tags

Conversation

@codejedi365

@codejedi365 codejedi365 commented Sep 27, 2024 •

Copy link
Copy Markdown
Contributor

Purpose

  • Adds moving partial version reference tags automatically upon release

Rationale

In order to have GitHub Actions auto update an action, there needs to be a partial version tag. These two steps will automatically update a partial minor version and also a partial major tag as python-semantic-release creates a release.

ex. v9.8.9 is released, and then the v9.8 and a v9 tag are moved to reference the same release.

How did you test?

I ran the script code locally in a script file. I used the same global variables that would exist in the CI. The script I used is below.

How to Verify

#!/bin/bash

set -e

FULL_VERSION_TAG="$(git tag --list --sort=-v:refname | head -n1)"
echo "Last version tag: $FULL_VERSION_TAG"

MINOR_VERSION_TAG="$(echo "$FULL_VERSION_TAG" | cut -d. -f1,2)"
echo "Minor version tag: $MINOR_VERSION_TAG"

git tag --force --annotate "$MINOR_VERSION_TAG" "${FULL_VERSION_TAG}^{}" -m "$MINOR_VERSION_TAG"
git push -u origin "$MINOR_VERSION_TAG" --force


MAJOR_VERSION_TAG="$(echo "$FULL_VERSION_TAG" | cut -d. -f1)"
echo "Major version tag: $MAJOR_VERSION_TAG"

git tag --force --annotate "$MAJOR_VERSION_TAG" "${FULL_VERSION_TAG}^{}" -m "$MAJOR_VERSION_TAG"
git push -u origin "$MAJOR_VERSION_TAG" --force

@codejedi365 codejedi365 self-assigned this Sep 27, 2024
@codejedi365
codejedi365 force-pushed the ci/add-partial-version-reference-tags branch from 080449d to 0faec22 Compare September 28, 2024 06:19
@codejedi365
codejedi365 force-pushed the ci/add-partial-version-reference-tags branch from 0faec22 to 589168e Compare September 28, 2024 06:32
@codejedi365
codejedi365 merged commit 886324c into python-semantic-release:master Sep 28, 2024
@codejedi365
codejedi365 deleted the ci/add-partial-version-reference-tags branch September 28, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant