ci: Add ability to reupload after borked release

This commit is contained in:
Florian Bruhin 2025-10-24 14:33:24 +02:00
parent 0f320051e0
commit e208f5e121
2 changed files with 20 additions and 15 deletions

View File

@ -12,6 +12,7 @@ on:
- 'patch'
- 'minor'
- 'major'
- 'reupload' # reupload last release
# FIXME do we want a possibility to do prereleases here?
python_version:
description: 'Python version'
@ -84,7 +85,7 @@ jobs:
gpg --import <<< "${{ secrets.QUTEBROWSER_BOT_GPGKEY }}"
- name: Bump version
id: bump
run: "tox -e update-version -- ${{ github.event.inputs.release_type }}"
run: "tox -e update-version -- ${{ inputs.release_type }}"
- name: Check milestone
uses: actions/github-script@v8
with:
@ -101,22 +102,24 @@ jobs:
core.setFailed(`Found open milestone ${milestone.title} with ${milestone.open_issues} open and ${milestone.closed_issues} closed issues!`);
}
- name: Push release commit/tag
if: ${{ inputs.release_type != 'reupload' }}
run: |
git push origin ${{ steps.find-branch.outputs.result }}
git push origin v${{ steps.bump.outputs.version }}
- name: Cherry-pick release commit
if: ${{ github.event.inputs.release_type == 'patch' }}
if: ${{ inputs.release_type == 'patch' }}
run: |
git checkout main
git cherry-pick -x v${{ steps.bump.outputs.version }}
git push origin main
git checkout v${{ steps.bump.outputs.version_x }}
- name: Create release branch
if: ${{ github.event.inputs.release_type != 'patch' }}
if: ${{ inputs.release_type == 'minor' || inputs.release_type == 'major' }}
run: |
git checkout -b v${{ steps.bump.outputs.version_x }}
git push --set-upstream origin v${{ steps.bump.outputs.version_x }}
- name: Create GitHub draft release
if: ${{ inputs.release_type != 'reupload' }}
id: create-release
uses: softprops/action-gh-release@v2
with:
@ -143,7 +146,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ github.event.inputs.python_version }}
python-version: ${{ inputs.python_version }}
- name: Import GPG Key
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |

View File

@ -60,7 +60,7 @@ def show_commit():
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Update release version.")
parser.add_argument('bump', action="store",
choices=["major", "minor", "patch"],
choices=["major", "minor", "patch", "dummy"],
help="Update release version")
parser.add_argument('--commands', action="store_true",
help="Only show commands to run post-release.")
@ -70,7 +70,8 @@ if __name__ == "__main__":
if not args.commands:
verify_branch(args.bump)
bump_version(args.bump)
if args.bump != "dummy":
bump_version(args.bump)
show_commit()
import qutebrowser
@ -87,15 +88,16 @@ if __name__ == "__main__":
print(f"Outputs for {version} written to GitHub Actions output file")
else:
print("Run the following commands to create a new release:")
print("* git push origin; git push origin v{v}".format(v=version))
if args.bump == 'patch':
print("* git checkout main && git cherry-pick -x v{v} && "
"git push origin".format(v=version))
else:
print("* git branch v{x} v{v} && git push --set-upstream origin v{x}"
.format(v=version, x=version_x))
print("* Create new release via GitHub (required to upload release "
"artifacts)")
if args.bump != 'dummy':
print("* git push origin; git push origin v{v}".format(v=version))
if args.bump == 'patch':
print("* git checkout main && git cherry-pick -x v{v} && "
"git push origin".format(v=version))
else:
print("* git branch v{x} v{v} && git push --set-upstream origin v{x}"
.format(v=version, x=version_x))
print("* Create new release via GitHub (required to upload release "
"artifacts)")
print("* Linux: git fetch && git checkout v{v} && "
"tox -e build-release -- --upload"
.format(v=version))