-
Notifications
You must be signed in to change notification settings - Fork 86
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
Dev 846 release ci fix #1216
Merged
dimitri-yatsenko
merged 26 commits into
datajoint:master
from
yambottle:DEV-846-release-ci-fix
Mar 24, 2025
+281
−280
Merged
Dev 846 release ci fix #1216
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
fd48651
ci: 🎨 consolidate doc release by workflow_call
yambottle 6490bf0
test: 🧪 update ci matrix
yambottle 7d2f539
fix: 🐛 add missing flake8 test
yambottle 7b1d5fb
ci: 🎨 re-organize ci
yambottle 12f9a8c
fix: 🐛 typo
yambottle 3fcd16f
fix: 🐛 fix dependency
yambottle b165b98
ci: 🎨 split test and release ci
yambottle 1449c1b
fix: 🐛 found pyproject.toml and version.py out of sync
yambottle 4ff6af4
ci: 🎨 improvements and cleanups
yambottle cff5187
fix: 🎨 black failed after changing pyproject.toml:required-python=">=…
yambottle 076286d
build: 🚧 improving pyproject.yaml and release:build step
yambottle 160d87c
build: 🎨 pyproject dynamically syncs from version.py | update optiona…
yambottle f484bf2
fix: 🎨 reorganize tool.setuptools in pyproject
yambottle 713dad0
ci: 🎨 improve pyproject.toml and release flow
yambottle 912f4c9
ci: 🎨 add release to testpypi
yambottle 3e62ad6
fix: 🐛 missing testpypi credentials
yambottle e56f298
fix: 🐛 indentation
yambottle daac032
feat: ✨ add github actions lint pre-commit hook... This is so nice!
yambottle 776e64a
fix: 🎨 bump versions
yambottle 55b453a
ci: 📝 update comments
yambottle 8724462
ci: ⚡️ improve description
yambottle 9649071
build: 📝 add comments
yambottle 007652a
fix: 🔥 remove white space/end of file checks
yambottle a0fc4ea
fix: 🐛 only run test on necessary file edits
yambottle 0d0f504
fix: 🐛 fix lint/test trigger
yambottle b1ae5ec
Merge branch 'master' into DEV-846-release-ci-fix
yambottle 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
ci: 🎨 add release to testpypi
commit 912f4c9b0a8cdb1a403bc4f5cb2494f7e1e2b663
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 |
---|---|---|
@@ -1,6 +1,14 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
testpypi: | ||
description: 'Release to TestPyPI then skip the rest' | ||
default: 'false' | ||
type: choice | ||
options: | ||
- 'true' | ||
- 'false' | ||
jobs: | ||
build-release: | ||
runs-on: ubuntu-latest | ||
|
@@ -12,6 +20,7 @@ jobs: | |
PY_VER: ${{matrix.py_ver}} | ||
TWINE_USERNAME: ${{secrets.twine_username}} | ||
TWINE_PASSWORD: ${{secrets.twine_password}} | ||
TESTPYPI: ${{ github.event.inputs.testpypi }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{matrix.py_ver}} | ||
|
@@ -30,15 +39,20 @@ jobs: | |
- name: Publish package | ||
run: | | ||
export HOST_UID=$(id -u) | ||
[ "$TESTPYPI" == "true" ] && export TWINE_REPOSITORY="testpypi" || export TWINE_REPOSITORY="pypi" | ||
docker compose run --build --quiet-pull \ | ||
-e TWINE_USERNAME=${TWINE_USERNAME} -e TWINE_PASSWORD=${TWINE_PASSWORD} app \ | ||
sh -c "pip install twine && python -m twine upload dist/*" | ||
-e TWINE_USERNAME=${TWINE_USERNAME} \ | ||
-e TWINE_PASSWORD=${TWINE_PASSWORD} \ | ||
-e TWINE_REPOSITORY=${TWINE_REPOSITORY} \ | ||
app sh -c "pip install twine && python -m twine upload dist/*" | ||
- name: Login to DockerHub | ||
if: ${{ github.event.inputs.testpypi == 'false' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{secrets.docker_username}} | ||
password: ${{secrets.docker_password}} | ||
- name: Publish image | ||
if: ${{ github.event.inputs.testpypi == 'false' }} | ||
run: | | ||
IMAGE=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Repository}}") | ||
TAG=$(docker images --filter "reference=datajoint/datajoint*" --format "{{.Tag}}") | ||
|
@@ -51,6 +65,7 @@ jobs: | |
|| echo "skipping 'latest' tag..." | ||
# Make sure all above release targets are done first, then make a GH release | ||
- name: Make release notes | ||
if: ${{ github.event.inputs.testpypi == 'false' }} | ||
run: | | ||
DJ_VERSION=$(grep -oP '\d+\.\d+\.\d+' datajoint/version.py) | ||
RELEASE_BODY=$(python -c \ | ||
|
@@ -61,6 +76,7 @@ jobs: | |
echo "$RELEASE_BODY" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Create GH release | ||
if: ${{ github.event.inputs.testpypi == 'false' }} | ||
id: create_gh_release | ||
uses: actions/create-release@v1 | ||
env: | ||
|
@@ -73,6 +89,7 @@ jobs: | |
draft: false | ||
# Upload package as release assets | ||
- name: Upload pip wheel asset to release | ||
if: ${{ github.event.inputs.testpypi == 'false' }} | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
@@ -82,6 +99,7 @@ jobs: | |
asset_name: pip-datajoint-${{env.DJ_VERSION}}.whl | ||
asset_content_type: application/zip | ||
- name: Upload pip sdist asset to release | ||
if: ${{ github.event.inputs.testpypi == 'false' }} | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
@@ -92,6 +110,7 @@ jobs: | |
asset_content_type: application/gzip | ||
# only release docs when a release is published | ||
call-publish-docs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consolidated previous duplicated doc release step, this is going to reuse the manual doc release workflow |
||
if: ${{ github.event.inputs.testpypi == 'false' }} | ||
needs: build-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manual trigger + optionally release to TestPyPI