Create Release #1
This file contains 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
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
paths: | |
- pyproject.toml | |
env: | |
python: 3.11 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip -U setuptools | |
- name: Get version using setuptools and save as variable use newer syntax | |
id: get_version | |
run: | | |
echo ::set-output name=version::$(python -c "import setuptools; print(setuptools.__version__)") | |
- name: Compare version with latest release tag | |
run: | | |
if [ "v${{ steps.get_version.outputs.version }}" != "${{ github.ref }}" ]; then | |
echo "Version mismatch" | |
exit 1 | |
fi | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |