Skip to content

Commit 2e69ba3

Browse files
authored
Merge branch 'main' into doc/fixed-merge-conflict
2 parents 78d02c9 + 1290f9d commit 2e69ba3

File tree

4 files changed

+69
-175
lines changed

4 files changed

+69
-175
lines changed

.github/workflows/build-python.yml

-14
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,6 @@ jobs:
239239
run: pdm build
240240
- name: Install Poetry
241241
uses: snok/install-poetry@v1
242-
- name: Create new project and install server wheel (Poetry)
243-
run: |
244-
poetry new ./install-test
245-
cd ./install-test
246-
sed -i 's/^\(python *= *\).*$/\1">=3.10,<3.12"/' pyproject.toml
247-
poetry add "$(ls ../dist/*.whl)[hub]"
248242
- name: Create new project, install wheel and import (Poetry)
249243
run: |
250244
poetry new ./install-run
@@ -285,14 +279,6 @@ jobs:
285279
cache: false
286280
- name: Build wheel
287281
run: pdm build
288-
- name: Create new project, install server wheel (PDM)
289-
run: |
290-
mkdir ./install-test
291-
cd ./install-test
292-
pdm init --python 3.10 -n .
293-
sed -i 's/^\(requires-python *= *\).*$/\1">=3.10,<3.12"/' pyproject.toml
294-
pdm add "$(ls ../dist/*.whl)[hub]"
295-
pdm run python -c "import giskard"
296282
- name: Create new project, install wheel and import (PDM)
297283
run: |
298284
mkdir ./install-run

.github/workflows/create-release.yml

+68-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Start a new release
1+
name: Release and publish a new version
22

33
on:
44
workflow_dispatch:
@@ -27,6 +27,13 @@ jobs:
2727
run: |
2828
echo "Job failed due to user not being a member of Giskard-AI organization and the 'safe for build' label not being set on the PR"
2929
exit 1
30+
31+
- name: Write release version env vars (with/without v)
32+
run: |
33+
VERSION_NAME="v${{ inputs.version }}"
34+
VERSION_NUMBER="${VERSION_NAME:1}"
35+
echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_ENV
36+
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV
3037
3138
- name: Checkout code
3239
uses: actions/[email protected]
@@ -36,7 +43,7 @@ jobs:
3643
token: ${{ secrets.RELEASE_PAT_TOKEN }} # Needed to trigger other actions
3744

3845
- name: Edit pyproject.toml
39-
run: sed -i 's/^\(version *= *\).*$/\1"${{ inputs.version }}"/' pyproject.toml
46+
run: sed -i 's/^\(version *= *\).*$/\1"${{ env.VERSION_NUMBER }}"/' pyproject.toml
4047

4148
- name: Remove dark theme logo from README
4249
run: sed -i 's/.*#gh-dark-mode-only.*//' README.md
@@ -47,36 +54,74 @@ jobs:
4754
python-version: '3.10'
4855
cache: false
4956

50-
- name: Build release candidate wheel
51-
run: pdm build
52-
53-
- name: Upload RC wheel artifact
54-
uses: actions/upload-artifact@v4
55-
with:
56-
name: rc-wheel-${{ inputs.version }}
57-
path: dist/*whl
58-
if-no-files-found: error
59-
retention-days: 1
60-
6157
- name: "@slack Release process started"
6258
id: slack
6359
uses: slackapi/[email protected]
6460
with:
6561
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
6662
slack-message: |-
67-
Release *v${{ inputs.version }}* is on the way :rocket:
63+
Release *${{ env.VERSION_NAME }}* is on the way :rocket:
6864
<${{ github.server_url }}/${{ github.actor }}|@${{ github.actor }}> | <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|commit> <!channel>
6965
env:
7066
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
7167

72-
- name: Trigger release process in legacy-hub
73-
uses: peter-evans/repository-dispatch@v3
68+
- name: Configure git
69+
run: |
70+
git config --global user.name 'BotReleaser'
71+
git config --global user.email '[email protected]'
72+
73+
- name: Adding file
74+
run: |
75+
git add pyproject.toml
76+
git fetch --quiet --tags
77+
git commit -m "${{ env.VERSION_NAME }}" --allow-empty
78+
git tag ${{ env.VERSION_NAME }}
79+
80+
- name: Push to main and tags
81+
run: |
82+
git push origin main
83+
git push origin ${{ env.VERSION_NAME }}
84+
85+
# build .tar.gz sdist tarball
86+
- name: Build source distribution tarball
87+
run: pdm build
88+
89+
- name: Create Github Release
90+
id: github-release
91+
uses: softprops/action-gh-release@v2
92+
with:
93+
tag_name: ${{ env.VERSION_NAME }}
94+
fail_on_unmatched_files: true
95+
generate_release_notes: true
96+
files: |
97+
dist/giskard-*.tar.gz
98+
dist/giskard-*.whl
99+
100+
- name: Push to Pipy
101+
run: pdm publish --no-build --username "${{ secrets.PIPY_USERNAME }}" --password "${{ secrets.PIPY_PASSWORD }}"
102+
103+
- name: Set job success env var
104+
run: |
105+
echo "JOB_SUCCESS=true" >> $GITHUB_ENV
106+
107+
- name: "@slack Share release process completion"
108+
# cancellable always() https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
109+
if: ${{ !cancelled() }}
110+
uses: slackapi/[email protected]
111+
env:
112+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
113+
ON_SUCCESS: |-
114+
*${{ env.VERSION_NAME }}* has been published to PyPI ! :python: :tada:
115+
<${{ steps.github-release.outputs.url }}|Release notes> | <https://pypi.org/project/giskard/${{ env.VERSION_NUMBER }}|PyPI> <!channel>
116+
ON_FAILURE: |-
117+
Could not publish *${{ env.VERSION_NAME }}* to PyPI :x:
118+
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|logs> <!channel>
74119
with:
75-
token: ${{ secrets.RELEASE_PAT_TOKEN }}
76-
event-type: create-release
77-
repository: ${{ github.repository_owner }}/legacy-hub
78-
client-payload: |
120+
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
121+
slack-message: ${{ env.JOB_SUCCESS == 'true' && env.ON_SUCCESS || env.ON_FAILURE }}
122+
# reploy_broadcast == also send to channel
123+
payload: |
79124
{
80-
"version_name": "v${{ inputs.version }}",
81-
"slack_thread_id": "${{ steps.slack.outputs.thread_ts }}"
82-
}
125+
"thread_ts": "${{ steps.slack.outputs.thread_ts }}",
126+
"reply_broadcast": true
127+
}

.github/workflows/post-release.yml

-137
This file was deleted.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ giskard = "giskard.integrations.mlflow.giskard_evaluator:GiskardEvaluator"
140140
name = "giskard"
141141
readme = "README.md"
142142
license = { text = "Apache Software License 2.0" }
143-
version = "2.13.0"
143+
version = "2.14.0"
144144
description = "The testing framework dedicated to ML models, from tabular to LLMs"
145145
authors = [{ name = "Giskard AI", email = "[email protected]" }]
146146
keywords = ["Artificial Intelligence", "Machine Learning", "Quality", "MLOps"]

0 commit comments

Comments
 (0)