weekly-preview #299
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
| name: weekly-preview | |
| permissions: | |
| contents: read | |
| on: | |
| schedule: | |
| - cron: "0 2 * * 0" # 02:00 of every Sunday | |
| jobs: | |
| static-checks: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| opt: ["codeformat", "mypy"] | |
| steps: | |
| - name: Clean unused tools | |
| run: | | |
| find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc /usr/local/.ghcup | |
| sudo docker system prune -f | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip wheel | |
| python -m pip install --no-build-isolation -r requirements-dev.txt | |
| - name: Lint and type check | |
| run: | | |
| # clean up temporary files | |
| $(pwd)/runtests.sh --build --clean | |
| $(pwd)/runtests.sh --build --${{ matrix.opt }} | |
| packaging: | |
| if: github.repository == 'Project-MONAI/MONAI' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: dev | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install setuptools | |
| run: | | |
| python -m pip install --user --upgrade setuptools wheel packaging | |
| - name: Build distribution | |
| run: | | |
| export HEAD_COMMIT_ID=$(git rev-parse HEAD) | |
| sed -i 's/name\ =\ monai$/name\ =\ monai-weekly/g' setup.cfg | |
| echo "__commit_id__ = \"$HEAD_COMMIT_ID\"" >> monai/__init__.py | |
| git diff setup.cfg monai/__init__.py | |
| git config user.name "CI Builder" | |
| git config user.email "monai.contact@gmail.com" | |
| git add setup.cfg monai/__init__.py | |
| git commit -m "Weekly build at $HEAD_COMMIT_ID" | |
| export YEAR_WEEK=$(date +'%y%U') | |
| echo "Year week for tag is ${YEAR_WEEK}" | |
| if ! [[ $YEAR_WEEK =~ ^[0-9]{4}$ ]] ; then echo "Wrong 'year week' format. Should be 4 digits."; exit 1 ; fi | |
| git tag "1.7.dev${YEAR_WEEK}" | |
| git log -1 | |
| git tag --list | |
| python setup.py sdist bdist_wheel | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_TOKEN }} |