misc: changed some things around in the autotagger
This commit is contained in:
parent
6c7871c36b
commit
d0697dd3af
1 changed files with 9 additions and 16 deletions
|
@ -25,26 +25,19 @@ jobs:
|
|||
gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase : ${{ secrets.GPG_PASSPHRASE }}
|
||||
|
||||
- name: Extract commit message
|
||||
id: extract_commit_message
|
||||
run: echo "::set-output name=message::$(git log --format=%B -n 1 $GITHUB_SHA)"
|
||||
|
||||
- name: Get new version
|
||||
id: get_version
|
||||
run: echo "::set-output name=version::$(awk -F '=' '/^ *version/ {gsub(/[[:space:]]/, "", $2); print $2}' pyproject.toml)"
|
||||
|
||||
- name: Get latest tag
|
||||
id: get_latest_tag
|
||||
- name: Set output variables
|
||||
id: vars
|
||||
run: |
|
||||
git fetch --tags
|
||||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
echo "::set-output name=latest_tag::$LATEST_TAG"
|
||||
echo "::set-output name=latest_tag::$(git describe --tags `git rev-list --tags --max-count=1`)"
|
||||
echo "::set-output name=version::$(awk -F '=' '/^ *version/ {gsub(/[[:space:]]/, "", $2); print $2}' pyproject.toml)"
|
||||
echo "::set-output name=message::$(git log --format=%B -n 1 $GITHUB_SHA)"
|
||||
|
||||
- name: Compare version and latest tag
|
||||
id: compare
|
||||
run: |
|
||||
VERSION=${{ steps.get_version.outputs.version }}
|
||||
LATEST_TAG=${{ steps.get_latest_tag.outputs.latest_tag }}
|
||||
VERSION=${{ steps.vars.outputs.version }}
|
||||
LATEST_TAG=${{ steps.vars.outputs.latest_tag }}
|
||||
if [ "$VERSION" = "$LATEST_TAG" ]; then
|
||||
echo "::set-output name=latest_tag::$LATEST_TAG"
|
||||
else
|
||||
|
@ -54,14 +47,14 @@ jobs:
|
|||
- name: Create tag
|
||||
if: steps.compare.outputs.version
|
||||
run: |
|
||||
VERSION=${{ steps.get_version.outputs.version }}
|
||||
VERSION=${{ steps.vars.outputs.version }}
|
||||
git tag -s $VERSION -m "version bumped to $VERSION"
|
||||
git push origin $VERSION
|
||||
|
||||
- name: Update latest tag
|
||||
if: steps.compare.outputs.latest_tag
|
||||
run: |
|
||||
MESSAGE=${{ steps.extract_commit_message.outputs.message }}
|
||||
MESSAGE=${{ steps.vars.outputs.message }}
|
||||
LATEST_TAG=${{ steps.compare.outputs.latest_tag }}
|
||||
git tag -fs $LATEST_TAG -m "$MESSAGE"
|
||||
git push origin $LATEST_TAG --force
|
||||
|
|
Loading…
Reference in a new issue