.github/workflows/release.yml #19
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 | ||
|
Check failure on line 1 in .github/workflows/release.yml
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'dj/__about__.py' | ||
| - 'datajunction/__about__.py' | ||
| jobs: | ||
| publish: | ||
| env: | ||
| PDM_DEPS: 'urllib3<2' | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ['3.10'] | ||
| runs-on: 'ubuntu-latest' | ||
| defaults: | ||
| run: | ||
| working-directory: ${{ github.event.inputs.library == 'server' && '.' || './client/python' }} | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install Hatch | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install hatch | ||
| - uses: pdm-project/setup-pdm@v3 | ||
| name: Setup PDM | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| architecture: x64 | ||
| prerelease: true | ||
| enable-pep582: true | ||
| - name: Configure Git | ||
| run: | | ||
| git config user.name "GitHub Actions Bot" | ||
| git config user.email "<>" | ||
| - uses: dorny/paths-filter@v2 | ||
| id: changes | ||
| with: | ||
| filters: | | ||
| server: | ||
| - 'dj/__about__.py' | ||
| client: | ||
| - 'datajunction/__about__.py' | ||
| - name: Tag release | ||
| run: | | ||
| export NEW_VERSION=v$(hatch version) | ||
| export LIBRARY=${{ steps.changes.outputs.server ? "server" : "client" }} | ||
| git tag -a $NEW_VERSION-$LIBRARY -m $NEW_VERSION-$LIBRARY | ||
| git push origin $NEW_VERSION-$LIBRARY | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} | ||
| - name: Publish to pypi | ||
| env: | ||
| HATCH_INDEX_USER: __token__ | ||
| HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} | ||
| run: | | ||
| hatch build | ||
| hatch publish | ||
| - name: Create Github release | ||
| run: | | ||
| export LIBRARY=${{ "server" ? steps.changes.outputs.server : "client" }} | ||
| gh release create $(hatch version)-$LIBRARY --generate-notes | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} | ||