forked from SolaceLabs/solace-ai-connector
-
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.
DATAGO-79372: Add Publish workflow (#3)
- Loading branch information
Showing
2 changed files
with
78 additions
and
1 deletion.
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,74 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: choice | ||
required: true | ||
description: "Version bump type" | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/solace_ai_connector | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ssh-key: ${{ secrets.COMMIT_KEY }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install hatch | ||
run: | | ||
pip install --upgrade pip | ||
pip install hatch | ||
- name: Bump Version | ||
run: | | ||
CURRENT_VERSION=$(hatch version) | ||
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV | ||
hatch version "${{ github.event.inputs.version }}" | ||
NEW_VERSION=$(hatch version) | ||
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV | ||
- name: Fail if the current version doesn't exist | ||
if: env.CURRENT_VERSION == '' | ||
run: exit 1 | ||
|
||
- name: Build project for distribution | ||
run: hatch build | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "dist/*.whl" | ||
makeLatest: true | ||
generateReleaseNotes: true | ||
tag: ${{ env.CURRENT_VERSION }} | ||
|
||
- name: Commit new version | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -a -m "[ci skip] Bump version to $NEW_VERSION" | ||
git push |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build" | |
|
||
[project] | ||
name = "solace_ai_connector" | ||
version = "0.0.1" | ||
dynamic = ["version"] | ||
authors = [ | ||
{ name="Edward Funnekotter", email="[email protected]" }, | ||
] | ||
|
@@ -39,3 +39,6 @@ solace-ai-connector-gen-docs = "solace_ai_connector.tools.gen_component_docs:mai | |
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/solace_ai_connector"] | ||
|
||
[tool.hatch.version] | ||
path = "src/solace_ai_connector/__init__.py" |