Skip to content

Commit 044966a

Browse files
refactor: rename some workflow file
1 parent 745b8bd commit 044966a

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.github/workflows/bump_commit_release_branch.yml renamed to .github/workflows/pre_release.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
git config user.name github-actions
3636
git config user.email github-actions@github.com
3737
38-
- name: Create PR with the bump commit
38+
- name: Add the bump commit
3939
run: |
4040
git fetch --quiet
4141
@@ -49,3 +49,33 @@ jobs:
4949
git push
5050
env:
5151
GH_TOKEN: ${{ github.token }} # needed for gh cli
52+
53+
- name: create draft release
54+
run: |
55+
curl https://raw.githubusercontent.com/kili-technology/kili-python-sdk/main/.github/scripts/utils.sh --output utils.sh
56+
source ./utils.sh # to get the bump_version function
57+
58+
# Get release version
59+
release_version=$(get_sdk_version_from_pyproject_toml)
60+
echo "Release version: $release_version"
61+
62+
# tag and push the tag
63+
# -f to overwrite the tag if it already exists
64+
# -a to create an annotated tag
65+
git fetch --quiet
66+
git tag -f -a $release_version -m "Release $release_version"
67+
git push origin $release_version
68+
69+
# create draft release
70+
link_to_draft=$(gh release create $release_version --draft --title "Release $release_version" --generate-notes --notes-start-tag $latest_release)
71+
echo "Link to draft release: $link_to_draft"
72+
73+
# filter the result to get the link
74+
# will match any string that starts with https:// and contains any number of characters that are not spaces.
75+
link_to_draft=$(echo "$link_to_draft" | grep -o 'https://[^ ]*')
76+
echo "Link to draft release: $link_to_draft"
77+
78+
echo "LINK_TO_DRAFT=$link_to_draft" >> $GITHUB_ENV
79+
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
80+
env:
81+
GH_TOKEN: ${{ github.token }} # needed for gh cli
File renamed without changes.

0 commit comments

Comments
 (0)