-
-
Notifications
You must be signed in to change notification settings - Fork 378
[GSK-2574] Improve release process #1773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 9e64a9e
Disable nightly tests in fork
vjern 9823811
Disable org member checks
vjern 0fadaf0
Disable tests on `.github/*` changes
vjern 7464b4d
fix: Disable tests on `.github/*` changes
vjern 20560d9
Build rc wheel in start release workflow
bfba215
Disable do-release
8930a01
Fix create-release dispatch
803ff85
Create GH release in post-release.yml
43451e9
Check out main in post-release
c886ea5
Add release commit, tell apart version name/number
49d613f
Reuse rc wheel in post-release
f85ec17
Fix wheel download in post-release
58adca1
Add space to readme
4c4e7c0
Disable sonar cloud scan in build-python
8e75503
Add space to readme
6e793e8
Reset README
b507ab3
Remove do-release
827fa69
Restore org member check steps
7e63df8
Restore other diff spans unrelated to feature
3b27f02
Restore step ifs and remove dev comments
6ee11f1
Reset build-python
3989499
Name rc wheel artifact after input version number
ac4e608
Set wheel artifact retention period & err behavior
c17730c
Add release pat token to post-release checkout
748fc63
Fix @channel slack message
b6bb91f
Fix `@channel` mention in post-release slack notif
d70daec
Make slack channel id a repo Actions variable
abee906
Fix version name in post-release slack notif
4fd5a4b
Send post-release end notif after pypi publishing
vjern 27439cb
Merge branch 'main' into feature/gsk-2574-improve-release-step
Hartorn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -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 }}" | ||
vjern marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ on: | |
| repository_dispatch: | ||
| types: | ||
| - post-release | ||
| # Client payload should contain | ||
| # version_name: vX.Y.Z (with prefix) | ||
| permissions: | ||
| contents: write | ||
|
|
||
|
|
@@ -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 | ||
vjern marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.