Skip to content

.github/workflows/release.yml #19

.github/workflows/release.yml

.github/workflows/release.yml #19

Workflow file for this run

name: Release

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 56, Col: 14): Unexpected symbol: '?'. Located at position 30 within expression: steps.changes.outputs.server ? "server" : "client", (Line: 73, Col: 14): Unexpected symbol: '"server"'. Located at position 1 within expression: "server" ? steps.changes.outputs.server : "client"
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 }}