Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
094e8a6
Adapt workflows to fork state
vjern Jan 26, 2024
9e64a9e
Disable nightly tests in fork
vjern Jan 26, 2024
9823811
Disable org member checks
vjern Jan 26, 2024
0fadaf0
Disable tests on `.github/*` changes
vjern Jan 26, 2024
7464b4d
fix: Disable tests on `.github/*` changes
vjern Jan 26, 2024
20560d9
Build rc wheel in start release workflow
Jan 26, 2024
bfba215
Disable do-release
Jan 26, 2024
8930a01
Fix create-release dispatch
Jan 26, 2024
803ff85
Create GH release in post-release.yml
Jan 29, 2024
43451e9
Check out main in post-release
Jan 29, 2024
c886ea5
Add release commit, tell apart version name/number
Jan 29, 2024
49d613f
Reuse rc wheel in post-release
Jan 29, 2024
f85ec17
Fix wheel download in post-release
Jan 29, 2024
58adca1
Add space to readme
Jan 29, 2024
4c4e7c0
Disable sonar cloud scan in build-python
Jan 29, 2024
8e75503
Add space to readme
Jan 29, 2024
6e793e8
Reset README
Jan 30, 2024
b507ab3
Remove do-release
Jan 30, 2024
827fa69
Restore org member check steps
Jan 30, 2024
7e63df8
Restore other diff spans unrelated to feature
Jan 30, 2024
3b27f02
Restore step ifs and remove dev comments
Jan 30, 2024
6ee11f1
Reset build-python
Jan 30, 2024
3989499
Name rc wheel artifact after input version number
Jan 31, 2024
ac4e608
Set wheel artifact retention period & err behavior
Jan 31, 2024
c17730c
Add release pat token to post-release checkout
Jan 31, 2024
748fc63
Fix @channel slack message
Jan 31, 2024
b6bb91f
Fix `@channel` mention in post-release slack notif
Jan 31, 2024
d70daec
Make slack channel id a repo Actions variable
Jan 31, 2024
abee906
Fix version name in post-release slack notif
Jan 31, 2024
4fd5a4b
Send post-release end notif after pypi publishing
vjern Feb 1, 2024
27439cb
Merge branch 'main' into feature/gsk-2574-improve-release-step
Hartorn Feb 5, 2024
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
42 changes: 27 additions & 15 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,30 @@ jobs:
- name: Edit pyproject.toml
run: sed -i 's/^\(version *= *\).*$/\1"${{ inputs.version }}"/' pyproject.toml

- name: Configure git
run: |
git config --global user.name 'BotReleaser'
git config --global user.email '[email protected]'

- name: Adding file
run: |
git add pyproject.toml
git commit -m "v${{ inputs.version }}" --allow-empty
git tag v${{ inputs.version }}

- name: Push to main and tags
run: |
git push origin main
git push origin v${{ inputs.version }}
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.10'
cache: false

- name: Build release candidate wheel
run: pdm build

- name: Upload RC wheel artifact
uses: actions/upload-artifact@v4
with:
name: rc-wheel-${{ inputs.version }}
path: dist/*whl
if-no-files-found: error
retention-days: 1

- name: Trigger release process in giskard-hub
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.RELEASE_PAT_TOKEN }}
event-type: create-release
repository: ${{ github.repository_owner }}/giskard-hub
client-payload: |
{
"version_name": "v${{ inputs.version }}"
}
56 changes: 0 additions & 56 deletions .github/workflows/do-release.yml

This file was deleted.

82 changes: 79 additions & 3 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
repository_dispatch:
types:
- post-release
# Client payload should contain
# version_name: vX.Y.Z (with prefix)
permissions:
contents: write

Expand All @@ -24,20 +26,94 @@ jobs:
run: |
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"
exit 1

- name: Write release version env vars (with/without v)
run: |
VERSION_NAME="${{ github.event.client_payload.version_name }}"
VERSION_NUMBER="${VERSION_NAME:1}"
echo "VERSION_NUMBER=${VERSION_NUMBER}" >> $GITHUB_ENV
echo "VERSION_NAME=${VERSION_NAME}" >> $GITHUB_ENV

- name: Checkout code
uses: actions/[email protected]
with:
fetch-tags: true
ref: ${{ github.event.client_payload.version }}
ref: main
token: ${{ secrets.RELEASE_PAT_TOKEN }} # Needed to trigger other actions

- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.10'
cache: false

- name: Build wheel
run: pdm build
- name: Edit pyproject.toml
run: sed -i 's/^\(version *= *\).*$/\1"${{ env.VERSION_NUMBER }}"/' pyproject.toml

- name: Configure git
run: |
git config --global user.name 'BotReleaser'
git config --global user.email '[email protected]'

- name: Adding file
run: |
git add pyproject.toml
git fetch --quiet --tags
git commit -m "${{ env.VERSION_NAME }}" --allow-empty
git tag ${{ env.VERSION_NAME }}

- name: Push to main and tags
run: |
git push origin main
git push origin ${{ env.VERSION_NAME }}

- run: mkdir -p dist

- name: Download wheel (release candidate)
working-directory: dist
run: gh -R ${{ github.repository_owner }}/giskard run download -n rc-wheel-${{ env.VERSION_NUMBER }}
env:
GH_TOKEN: ${{ github.token }}

- name: Validate wheel version
working-directory: dist
run: |
python -m pip install pkginfo
ls giskard-*.whl | xargs -I {} python3 -c 'import pkginfo; print(pkginfo.wheel.Wheel("{}").version)' > WHEEL_VERSION
if [ ! `grep ${{ env.VERSION_NUMBER }} WHEEL_VERSION` ]
then
echo "Expected wheel version ${{ env.VERSION_NUMBER }}, got $(cat WHEEL_VERSION)"
exit 1
fi

# build .tar.gz sdist tarball
# --no-clean preserves the previously downloaded wheel in dist/
- name: Build source distribution tarball
run: pdm build --no-wheel --no-clean

- name: Create Github Release
id: github-release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION_NAME }}
fail_on_unmatched_files: true
generate_release_notes: true
files: |
dist/giskard-*.tar.gz
dist/giskard-*.whl

- name: Push to Pipy
run: pdm publish --no-build --username "${{ secrets.PIPY_USERNAME }}" --password "${{ secrets.PIPY_PASSWORD }}"

- name: Post to a Slack channel
id: slack
uses: slackapi/[email protected]
with:
# Slack channel id, channel name, or user id to post message.
# See also: https://api.slack.com/methods/chat.postMessage#channels
# On special mentions: https://api.slack.com/reference/surfaces/formatting#special-mentions
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
slack-message: "<!channel> New release: ${{ env.VERSION_NAME }} is being made !:tada:\nRelease notes there: ${{ steps.github-release.outputs.url }}"
# For posting a rich message using Block Kit
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}