Attempt #12 #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Tag New Releases | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
version-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get Latest Tag | ||
id: get-latest-tag | ||
uses: actions-ecosystem/[email protected] | ||
with: | ||
semver_only: true | ||
with_initial_version: false | ||
- name: Code vs Releases Version Check | ||
id: release-info | ||
run: | | ||
RELEASE_VERSION=$(echo $LATEST_RELEASE | tr -d "v ") | ||
VERSION=$(cat diplomat/__init__.py | grep "__version__" | cut -d "=" -f 2 | tr -d '" ') | ||
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] | ||
then | ||
echo "$VERSION is not a valid version!" | ||
exit 1 | ||
fi | ||
PROPOSED_TAG="v$VERSION" | ||
echo "Python package version: $VERSION" | ||
echo "Github release version: $RELEASE_VERSION" | ||
echo "Next proposed tag: $PROPOSED_TAG" | ||
echo "PYTHON_VERSION=$VERSION" >> "$GITHUB_OUTPUT" | ||
echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_OUTPUT" | ||
echo "NEXT_TAG=$PROPOSED_TAG" >> "$GITHUB_OUTPUT" | ||
env: | ||
LATEST_RELEASE: ${{ steps.get-latest-tag.outputs.tag }} | ||
outputs: | ||
RELEASE_VERSION: ${{ steps.release-info.outputs.RELEASE_VERSION }} | ||
PYTHON_VERSION: ${{ steps.release-info.outputs.PYTHON_VERSION }} | ||
NEXT_TAG: ${{ steps.release-info.outputs.NEXT_TAG }} | ||
create-new-release: | ||
uses: ./.github/workflows/publish-to-pypi.yml | ||
Check failure on line 47 in .github/workflows/release-update.yml GitHub Actions / .github/workflows/release-update.ymlInvalid workflow file
|
||
needs: | ||
- version-check | ||
if: ${{ needs.version-check.outputs.RELEASE_VERSION != needs.version-check.outputs.PYTHON_VERSION }} | ||
with: | ||
new-release-tag: ${{ needs.version-check.outputs.NEXT_TAG }} | ||
secrets: inherit | ||