Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions .github/workflows/bump_commit_release_branch.yml

This file was deleted.

112 changes: 0 additions & 112 deletions .github/workflows/create_draft_release.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Pre-release - Bump version & draft release
on:
workflow_dispatch:
inputs:
target_branch:
description: >
"This workflow will create a commit to bump version on a branch.
Enter the target branch: main for Saas, or release/XX.Y for a LTS version: "
required: true
type: string
default: "main"

jobs:
pre_release:
runs-on: ubuntu-latest
name: Bump version & draft release
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.target_branch}}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bump2version

- name: Set git identity
run: |
git config user.name github-actions
git config user.email github-actions@github.com

- name: Add the bump commit
run: |
git fetch --quiet

curl https://raw.githubusercontent.com/kili-technology/kili-python-sdk/main/.github/scripts/utils.sh --output utils.sh
source ./utils.sh # to get the bump_version function

# create bump commit
new_version=$(bump_version commit patch)
echo "New version (bump_version): $new_version"

git push
env:
GH_TOKEN: ${{ github.token }} # needed for gh cli

- name: create draft release
run: |
curl https://raw.githubusercontent.com/kili-technology/kili-python-sdk/main/.github/scripts/utils.sh --output utils.sh
source ./utils.sh # to get the get_sdk_version_from_pyproject_toml function

# Get release version
release_version=$(get_sdk_version_from_pyproject_toml)
echo "Release version: $release_version"

# tag and push the tag
# -a to create an annotated tag
git fetch --quiet
git tag -a $release_version -m "Release $release_version"
git push origin $release_version

# create draft release
link_to_draft=$(gh release create $release_version --draft --title "Release $release_version" --generate-notes --notes-start-tag $latest_release)
echo "Link to draft release: $link_to_draft"

# filter the result to get the link
# will match any string that starts with https:// and contains any number of characters that are not spaces.
link_to_draft=$(echo "$link_to_draft" | grep -o 'https://[^ ]*')
echo "Link to draft release: $link_to_draft"

echo "LINK_TO_DRAFT=$link_to_draft" >> $GITHUB_ENV
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ github.token }} # needed for gh cli
File renamed without changes.
Loading