Merge branch 'development' into v2.4.0 #2
Workflow file for this run
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: release-main | ||
| on: | ||
| release: | ||
| types: [published] | ||
| jobs: | ||
| set-version: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.10' | ||
| - name: Install build tools | ||
| run: | | ||
| python -m pip install --upgrade pip setuptools wheel build twine | ||
| - name: Determine package version | ||
| id: vars | ||
| run: | | ||
| echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT | ||
| - name: Build package | ||
| run: | | ||
| python -m build --sdist --wheel | ||
| - name: Export tag | ||
| id: vars | ||
| run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT | ||
| if: ${{ github.event_name == 'release' }} | ||
| - name: Update project version | ||
| run: | | ||
| sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml | ||
| env: | ||
| RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
| if: ${{ github.event_name == 'release' }} | ||
| - name: Upload updated pyproject.toml | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pyproject-toml | ||
| path: pyproject.toml | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| needs: [set-version] | ||
| steps: | ||
| - name: Check out | ||
| uses: actions/checkout@v4 | ||
| - name: Set up the environment | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Build dist | ||
| run: | | ||
| python setup.py sdist | ||
| - name: Twine check | ||
| run: | | ||
| pip install twine | ||
| last_dist=$(ls -t dist/smac-*.tar.gz | head -n 1) | ||
| twine_output=`twine check "$last_dist"` | ||
| if [[ "$twine_output" != "Checking $last_dist: PASSED" ]] | ||
| then | ||
| echo $twine_output | ||
| else | ||
| pip install $last_dist | ||
| fi | ||
| - name: Publish package | ||
| run: python -m twine upload --repository testpypi dist/* | ||
| env: | ||
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
| deploy-docs: | ||
| needs: publish | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out | ||
| uses: actions/checkout@v4 | ||
| - name: Set up the environment | ||
| uses: ./.github/actions/setup-python-env | ||
| - name: Deploy documentation | ||
| run: uv run mkdocs gh-deploy --force | ||