forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from SpecLad/release-2.7.99
Release v2.7.99
- Loading branch information
Showing
20 changed files
with
264 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Finalize release | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Discover pending release | ||
id: discover | ||
env: | ||
GH_TOKEN: "${{ github.token }}" | ||
run: | | ||
gh --repo="${{ github.repository }}" \ | ||
pr list --base master --state open --json number,headRefName \ | ||
--jq 'map(select(.headRefName | startswith("release-")))' \ | ||
> /tmp/release-prs.json | ||
if jq -e 'length < 1' /tmp/release-prs.json > /dev/null; then | ||
echo "No open release pull requests found." | ||
exit 1 | ||
elif jq -e 'length > 1' /tmp/release-prs.json > /dev/null; then | ||
echo "Multiple open release pull requests found:" | ||
jq -r '.[] | "https://github.com/${{ github.repository }}/pull/\(.number)"' /tmp/release-prs.json | ||
exit 1 | ||
fi | ||
jq -r '.[] | "prNumber=\(.number)", "version=\(.headRefName | ltrimstr("release-"))"' \ | ||
/tmp/release-prs.json >> "$GITHUB_OUTPUT" | ||
# When you use the default github.token to make changes in the repository, | ||
# it does not trigger further GitHub pipelines. We want to trigger CI for | ||
# the pull request and artifact building for the release, so we have to use | ||
# an app token. | ||
- name: Generate authentication token | ||
id: gen-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: "${{ secrets.CVAT_BOT_APP_ID }}" | ||
private-key: "${{ secrets.CVAT_BOT_PRIVATE_KEY }}" | ||
|
||
- name: Install dependencies | ||
run: | ||
sudo apt-get install -y pandoc | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
ref: "release-${{ steps.discover.outputs.version }}" | ||
|
||
- name: Verify that the release is new | ||
env: | ||
NEW_VERSION: "${{ steps.discover.outputs.version }}" | ||
run: | | ||
if git ls-remote --exit-code origin "refs/tags/v$NEW_VERSION" > /dev/null; then | ||
echo "Release v$NEW_VERSION already exists" | ||
exit 1 | ||
fi | ||
# Do post-release tasks before publishing the release. If anything goes wrong, | ||
# the dev-release-* branch can be deleted, and the whole process restarted again; | ||
# whereas we can't unmerge the release PR. | ||
|
||
- name: Create post-release branch | ||
run: | ||
git checkout -b "dev-release-${{ steps.discover.outputs.version }}" | ||
|
||
- name: Bump version | ||
run: | ||
./dev/update_version.py --minor | ||
|
||
- name: Commit post-release changes | ||
run: | | ||
git -c user.name='cvat-bot[bot]' -c user.email='cvat-bot[bot]@users.noreply.github.com' \ | ||
commit -a -m "Update ${{ github.ref_name }} after v${{ steps.discover.outputs.version }}" | ||
- name: Push post-release branch | ||
run: | ||
git push -u origin "dev-release-${{ steps.discover.outputs.version }}" | ||
|
||
- name: Create post-release pull request | ||
env: | ||
GH_TOKEN: "${{ steps.gen-token.outputs.token }}" | ||
run: | | ||
gh pr create \ | ||
--base="${{ github.ref_name }}" \ | ||
--title="Update ${{ github.ref_name }} after v${{ steps.discover.outputs.version }}" \ | ||
--body="" | ||
# Now publish the release. | ||
|
||
- name: Merge release pull request | ||
env: | ||
GH_TOKEN: "${{ steps.gen-token.outputs.token }}" | ||
run: | ||
gh pr merge --merge "${{ steps.discover.outputs.prNumber }}" --delete-branch | ||
|
||
- name: Create release | ||
env: | ||
GH_TOKEN: "${{ steps.gen-token.outputs.token }}" | ||
NEW_VERSION: "${{ steps.discover.outputs.version }}" | ||
run: | | ||
# We could grab the release notes from the PR description, but it could | ||
# be outdated if any changes were made on the release branch. So instead, | ||
# just re-extract them from the changelog again. | ||
./dev/gh_release_notes.sh \ | ||
| gh release create "v$NEW_VERSION" \ | ||
--target=master \ | ||
--title="v$NEW_VERSION" \ | ||
--notes-file=- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Prepare release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
newVersion: | ||
description: "Version number for the new release" | ||
required: true | ||
default: X.Y.Z | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Validate version number | ||
env: | ||
NEW_VERSION: "${{ inputs.newVersion }}" | ||
run: | | ||
if ! [[ "$NEW_VERSION" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then | ||
echo "Invalid version number" | ||
exit 1 | ||
fi | ||
# When you use the default github.token to make changes in the repository, | ||
# it does not trigger further GitHub pipelines. We want to trigger CI for | ||
# the pull request, so we have to use an app token. | ||
- name: Generate authentication token | ||
id: gen-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: "${{ secrets.CVAT_BOT_APP_ID }}" | ||
private-key: "${{ secrets.CVAT_BOT_PRIVATE_KEY }}" | ||
|
||
- name: Install dependencies | ||
run: | ||
sudo apt-get install -y pandoc | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Verify that the release is new | ||
run: | | ||
if git ls-remote --exit-code origin refs/tags/v${{ inputs.newVersion }} > /dev/null; then | ||
echo "Release v${{ inputs.newVersion }} already exists" | ||
exit 1 | ||
fi | ||
- name: Create release branch | ||
run: | ||
git checkout -b "release-${{ inputs.newVersion }}" | ||
|
||
- name: Collect changelog | ||
run: | ||
pipx run scriv collect --version="${{ inputs.newVersion }}" | ||
|
||
- name: Set the new version | ||
run: | ||
./dev/update_version.py --set="${{ inputs.newVersion }}" | ||
|
||
- name: Commit release preparation changes | ||
run: | | ||
git -c user.name='cvat-bot[bot]' -c user.email='cvat-bot[bot]@users.noreply.github.com' \ | ||
commit -a -m "Prepare release v${{ inputs.newVersion }}" | ||
- name: Push release branch | ||
run: | ||
git push -u origin "release-${{ inputs.newVersion }}" | ||
|
||
- name: Create release pull request | ||
env: | ||
GH_TOKEN: "${{ steps.gen-token.outputs.token }}" | ||
run: | | ||
./dev/gh_release_notes.sh \ | ||
| gh pr create \ | ||
--base=master \ | ||
--title="Release v${{ inputs.newVersion }}" \ | ||
--body-file=- |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
cvat-sdk~=2.7.5 | ||
cvat-sdk~=2.7.99 | ||
Pillow>=10.0.1 | ||
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = "2.7.5" | ||
VERSION = "2.7.99" |
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
# This script takes the release notes for the most recent release | ||
# and reformats them for use in GitHub. | ||
|
||
# In GitHub PR and release descriptions, a single line break is | ||
# equivalent to <br>, so we pipe the text through pandoc to unwrap all lines. | ||
|
||
set -eu | ||
|
||
repo_root="$(dirname "$0")/.." | ||
|
||
awk '/^## / { hn += 1; next } hn == 1 && !/^</' "$repo_root/CHANGELOG.md" \ | ||
| pandoc -f gfm -t gfm --wrap=none |
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
Oops, something went wrong.