fix: make minor_version_release.yml to run on the v1.x branch (#6547)

* Fix minor_version_release.yml to run on the v1.x branch

* review
This commit is contained in:
ZanSara 2023-12-14 10:34:18 +00:00 committed by GitHub
parent 923efd88b2
commit d0c115fc9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
name: Minor Version Release name: Minor Version Release (1.x)
on: on:
workflow_dispatch: workflow_dispatch:
@ -12,6 +12,8 @@ jobs:
steps: steps:
- name: Checkout this repo - name: Checkout this repo
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
ref: "v1.x"
- name: Define all versions - name: Define all versions
id: versions id: versions
@ -30,12 +32,12 @@ jobs:
git checkout -b v${{ steps.versions.outputs.current_release_minor }}.x git checkout -b v${{ steps.versions.outputs.current_release_minor }}.x
git push -u origin v${{ steps.versions.outputs.current_release_minor }}.x --tags git push -u origin v${{ steps.versions.outputs.current_release_minor }}.x --tags
- name: Bump version on main - name: Bump version on v1.x
shell: bash shell: bash
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
git checkout main git checkout v1.x
NEW_VERSION=$(awk -F. '/[0-9]+\./{$2++;print}' OFS=. < VERSION.txt) NEW_VERSION=$(awk -F. '/[0-9]+\./{$2++;print}' OFS=. < VERSION.txt)
echo "$NEW_VERSION" > VERSION.txt echo "$NEW_VERSION" > VERSION.txt
cat VERSION.txt cat VERSION.txt
@ -43,7 +45,7 @@ jobs:
git commit -m "Update unstable version to $NEW_VERSION" git commit -m "Update unstable version to $NEW_VERSION"
VERSION_TAG="v$NEW_VERSION" VERSION_TAG="v$NEW_VERSION"
git tag $VERSION_TAG -m"$VERSION_TAG" git tag $VERSION_TAG -m"$VERSION_TAG"
git push --atomic origin main $VERSION_TAG git push --atomic origin v1.x $VERSION_TAG
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
@ -56,5 +58,5 @@ jobs:
env: env:
RDME_API_KEY: ${{ secrets.README_API_KEY }} RDME_API_KEY: ${{ secrets.README_API_KEY }}
run: | run: |
git checkout main git checkout v1.x
python ./.github/utils/release_docs.py --new-version ${{ steps.versions.outputs.current_release_minor }} python ./.github/utils/release_docs.py --new-version ${{ steps.versions.outputs.current_release_minor }}