Upgrade black #13
Workflow file for this run
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
name: Create Release | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
POETRY_VERSION: "1.8.2" | |
PYTHON_VERSION: "3.9" | |
jobs: | |
autorelease: | |
name: Create Release | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Permacache Poetry | |
id: cache-poetry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.poetry | |
key: poetry | |
- name: Install latest version of Poetry | |
if: steps.cache-poetry.outputs.cache-hit != 'true' | |
run: | | |
POETRY_VERSION=$POETRY_VERSION curl -sSL https://install.python-poetry.org | python3 - | |
poetry --version | |
- name: Add Poetry to $PATH | |
run: | | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: Add version to environment vars | |
run: | | |
PROJECT_VERSION=$(poetry version --short) | |
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV | |
- name: Check if tag version matches project version | |
run: | | |
TAG=$(git describe HEAD --tags --abbrev=0) | |
echo $TAG | |
echo $PROJECT_VERSION | |
if [[ "$TAG" != "v$PROJECT_VERSION" ]]; then exit 1; fi | |
- name: Get Poetry version | |
run: poetry --version | |
- name: Check pyproject.toml validity | |
run: poetry check --no-interaction | |
- name: Release Notes | |
run: git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an <%ae>' --no-merges >> ".github/RELEASE-TEMPLATE.md" | |
- name: Create Release Draft | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: ".github/RELEASE-TEMPLATE.md" | |
draft: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |