Skip to content

Commit e60bd9b

Browse files
authored
ci(NoTicket): Use shared version bump action (#156)
1 parent b2f16e8 commit e60bd9b

File tree

1 file changed

+20
-32
lines changed

1 file changed

+20
-32
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,59 +27,47 @@ jobs:
2727
fetch-depth: 0
2828
ref: main
2929
token: ${{ secrets.RELEASE_PAT }}
30-
31-
- name: Set up Python 3.9
32-
uses: actions/setup-python@v2
33-
with:
34-
python-version: 3.9
35-
36-
- name: Install dependencies
37-
run: |
38-
python -m pip install --upgrade pip
39-
pip install argparse build semver twine
40-
shell: bash
4130

4231
- name: Setup git config
4332
run: |
4433
git config user.name "GitHub Actions Bot"
4534
git config user.email "<>"
4635
shell: bash
4736

48-
- name: Checkout action repo
49-
uses: actions/checkout@v2
50-
with:
51-
repository: firebolt-db/action-python-release
52-
path: release_action
53-
54-
- name: Generate new version tag
55-
id: tag_generation
37+
- name: Get changes since last release
38+
id: changes
5639
run: |
5740
OLD_TAG=$(git describe --tags --abbrev=0)
58-
OLD_VERSION=$(echo $OLD_TAG | cut -c 2-)
59-
echo "Old tag was ${OLD_TAG}"
60-
CHANGE_LOG=$(git log $OLD_TAG..HEAD --pretty=format:%s)
61-
NEW_VERSION=$(python3 release_action/scripts/generate_version_tag.py "${CHANGE_LOG}" $OLD_VERSION --prerelease_tag "${{ inputs.pre-release-tag }}" --major_release "${{ inputs.major-release }}")
62-
NEW_TAG="v"$NEW_VERSION
63-
echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT
64-
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
65-
shell: bash
41+
CHANGES=$(git log $OLD_TAG..HEAD --pretty=format:%s)
42+
echo "changes<<EOF" >> $GITHUB_OUTPUT
43+
echo "$CHANGES" >> $GITHUB_OUTPUT
44+
echo "EOF" >> $GITHUB_OUTPUT
45+
# Strip 'v' prefix from the old tag if it exists
46+
echo "old_tag=$(echo $OLD_TAG | sed 's/^v//')" >> $GITHUB_OUTPUT
47+
48+
- name: Generate version
49+
id: version
50+
uses: firebolt-db/action-generate-version@v1
51+
with:
52+
changes: ${{ steps.changes.outputs.changes }}
53+
old-tag: ${{ steps.changes.outputs.old_tag }}
6654

6755
- name: Version bump
6856
run: |
6957
# Bump version = <number> in version file
70-
sed -i "s/SdkVersion string = .*/SdkVersion string = \"${{ steps.tag_generation.outputs.new_version }}\"/g" version/version.go
58+
sed -i "s/SdkVersion string = .*/SdkVersion string = \"v${{ steps.version.outputs.new-tag }}\"/g" version/version.go
7159
git add version/version.go
72-
git commit -m "Automatic version bump to ${{ steps.tag_generation.outputs.new_tag }}"
60+
git commit -m "Automatic version bump to v${{ steps.version.outputs.new-tag }}"
7361
git push origin main
7462
shell: bash
7563

7664
- name: Publish tag on github
7765
run: |
78-
git tag ${{ steps.tag_generation.outputs.new_tag }}
79-
git push origin ${{ steps.tag_generation.outputs.new_tag }}
66+
git tag v${{ steps.version.outputs.new-tag }}
67+
git push origin v${{ steps.version.outputs.new-tag }}
8068
shell: bash
8169

8270
- name: Run go list
8371
run: |
84-
GOPROXY=proxy.golang.org go list -m github.com/firebolt-db/firebolt-go-sdk@${{ steps.tag_generation.outputs.new_tag }}
72+
GOPROXY=proxy.golang.org go list -m github.com/firebolt-db/firebolt-go-sdk@v${{ steps.version.outputs.new-tag }}
8573
shell: bash

0 commit comments

Comments
 (0)