Skip to content

Bump pep8-naming from 0.13.3 to 0.14.1 (#398) #304

Bump pep8-naming from 0.13.3 to 0.14.1 (#398)

Bump pep8-naming from 0.13.3 to 0.14.1 (#398) #304

Workflow file for this run

name: Release
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
version-tag: ${{ steps.check-version.outputs.tag }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "sha=$(git rev-parse --verify --quiet HEAD^)" >> $GITHUB_OUTPUT
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/[email protected]
with:
version-command: |
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
- name: Bump version for developmental release
if: "! steps.check-version.outputs.tag"
run: |
poetry version patch &&
version=$(poetry version | awk '{ print $2 }') &&
poetry version $version.dev.$(date +%s)
- name: Build package
run: |
poetry build --ansi
- name: Save build as artifact
uses: actions/upload-artifact@v4
with:
name: build
path: "dist/"
publish:
name: Publish
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/merge-stardist-masks
permissions:
id-token: write
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build
path: "dist/"
- name: Publish package on PyPI
if: needs.build.outputs.version-tag
uses: pypa/[email protected]
- name: Publish package on TestPyPI
if: "! needs.build.outputs.version-tag"
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
release-draft:
name: Release drafter
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Publish the release notes
uses: release-drafter/[email protected]
with:
publish: ${{ needs.build.outputs.version-tag != '' }}
tag: ${{ needs.build.outputs.version-tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}