Skip to content
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
merged 26 commits into from
Mar 24, 2025
Merged
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 Mar 14, 2025
6490bf0
test: 🧪 update ci matrix
yambottle Mar 14, 2025
7d2f539
fix: 🐛 add missing flake8 test
yambottle Mar 14, 2025
7b1d5fb
ci: 🎨 re-organize ci
yambottle Mar 14, 2025
12f9a8c
fix: 🐛 typo
yambottle Mar 14, 2025
3fcd16f
fix: 🐛 fix dependency
yambottle Mar 14, 2025
b165b98
ci: 🎨 split test and release ci
yambottle Mar 14, 2025
1449c1b
fix: 🐛 found pyproject.toml and version.py out of sync
yambottle Mar 14, 2025
4ff6af4
ci: 🎨 improvements and cleanups
yambottle Mar 14, 2025
cff5187
fix: 🎨 black failed after changing pyproject.toml:required-python=">=…
yambottle Mar 14, 2025
076286d
build: 🚧 improving pyproject.yaml and release:build step
yambottle Mar 14, 2025
160d87c
build: 🎨 pyproject dynamically syncs from version.py | update optiona…
yambottle Mar 15, 2025
f484bf2
fix: 🎨 reorganize tool.setuptools in pyproject
yambottle Mar 15, 2025
713dad0
ci: 🎨 improve pyproject.toml and release flow
yambottle Mar 15, 2025
912f4c9
ci: 🎨 add release to testpypi
yambottle Mar 15, 2025
3e62ad6
fix: 🐛 missing testpypi credentials
yambottle Mar 15, 2025
e56f298
fix: 🐛 indentation
yambottle Mar 15, 2025
daac032
feat: ✨ add github actions lint pre-commit hook... This is so nice!
yambottle Mar 15, 2025
776e64a
fix: 🎨 bump versions
yambottle Mar 15, 2025
55b453a
ci: 📝 update comments
yambottle Mar 15, 2025
8724462
ci: ⚡️ improve description
yambottle Mar 15, 2025
9649071
build: 📝 add comments
yambottle Mar 15, 2025
007652a
fix: 🔥 remove white space/end of file checks
yambottle Mar 24, 2025
a0fc4ea
fix: 🐛 only run test on necessary file edits
yambottle Mar 24, 2025
0d0f504
fix: 🐛 fix lint/test trigger
yambottle Mar 24, 2025
b1ae5ec
Merge branch 'master' into DEV-846-release-ci-fix
yambottle Mar 24, 2025
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
Prev Previous commit
Next Next commit
ci: 🎨 add release to testpypi
yambottle committed Mar 15, 2025
commit 912f4c9b0a8cdb1a403bc4f5cb2494f7e1e2b663
23 changes: 21 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Release
on:
workflow_dispatch:
Copy link
Contributor Author

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

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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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: