name: Minor Version Release on: workflow_dispatch: env: PYTHON_VERSION: "3.9" jobs: sync: runs-on: ubuntu-latest steps: - name: Checkout this repo uses: actions/checkout@v4 with: ref: main - name: Define all versions id: versions shell: bash # We only need `major.minor` in Readme so we cut the full version string to the first two tokens run: | echo "current_release_minor=$(cut -d "." -f 1,2 < VERSION.txt)" >> "$GITHUB_OUTPUT" - name: Bump version on main shell: bash env: # We use the HAYSTACK_BOT_TOKEN here so the PR created by the step will # trigger required workflows and can be merged by anyone GITHUB_TOKEN: ${{ secrets.HAYSTACK_BOT_TOKEN }} run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" git checkout main # Create the release branch from the current unstable git checkout -b v${{ steps.versions.outputs.current_release_minor }}.x git push -u origin v${{ steps.versions.outputs.current_release_minor }}.x # Tag the base with X.Y.Z-rc0. # At this point VERSION.txt still contains the previous version and not # the one specified by the tag. # This is good though as we just need this to make reno work properly. NEW_VERSION=$(awk -F. '/[0-9]+\./{$2++;print}' OFS=. < VERSION.txt) echo "$NEW_VERSION" > VERSION.txt VERSION_TAG="v$NEW_VERSION" git tag "$VERSION_TAG" -m"$VERSION_TAG" git push --tags # Create the branch that bump version in dev branch cat VERSION.txt git checkout -b bump-version git add . git commit -m "Update unstable version to $NEW_VERSION" git push -u origin bump-version # Create the PR gh pr create -B main \ -H bump-version \ --title "Bump unstable version" \ --body "This PR bumps the unstable version for \`v2.x\`. \ The release branch \`v${{ steps.versions.outputs.current_release_minor }}.x\` has been correctly created. \ Verify documentation on Readme has been correctly updated before approving and merging this PR." \ --label "ignore-for-release-notes" - uses: actions/setup-python@v5 with: python-version: "${{ env.PYTHON_VERSION }}" - name: Install create_unstable_docs.py dependencies run: pip install requests - name: Release Readme version env: RDME_API_KEY: ${{ secrets.README_API_KEY }} run: | git checkout main python ./.github/utils/create_unstable_docs.py --new-version ${{ steps.versions.outputs.current_release_minor }}