Prepare release 0.21.2 #29
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: | |
- "*.*.*" # Push events to matching v*, i.e. v1.0.0, v20.15.10 | |
jobs: | |
autorelease: | |
name: Create Release | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
- name: Install latest version of Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Add Poetry to $PATH | |
run: | | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: Get Poetry version | |
run: poetry --version | |
- 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" != "$PROJECT_VERSION" ]]; then exit 1; fi | |
- name: Check pyproject.toml validity | |
run: poetry check --no-interaction | |
- name: Install deps | |
run: | | |
poetry config virtualenvs.in-project true | |
poetry install --no-interaction | |
- name: Build | |
run: poetry build | |
- 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 | |
files: | | |
dist/netbox_dns-${{env.PROJECT_VERSION}}-py3-none-any.whl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |