bump(release): v2.3.1 → v2.4.0 #69
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*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
autorelease: | |
name: Create Release | |
runs-on: "ubuntu-latest" | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- name: Harden Security Runner | |
uses: step-security/harden-runner@v2 | |
with: | |
egress-policy: block | |
disable-sudo: true | |
allowed-endpoints: > | |
api.github.com:443 | |
files.pythonhosted.org:443 | |
github.com:443 | |
install.python-poetry.org:443 | |
pypi.org:443 | |
python-poetry.org:443 | |
uploads.github.com:443 | |
docker.io:443 | |
githubapp.com:443 | |
docker.com:443 | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# ---------------------------------------------- | |
# Install poetry and project dependencies | |
# ---------------------------------------------- | |
- name: Setup Python and Poetry | |
uses: ./.github/actions/setup-poetry | |
# ---------------------------------------------- | |
# Grab version number | |
# ---------------------------------------------- | |
- name: Add version to environment vars | |
run: | | |
PROJECT_VERSION=$(poetry version --short) | |
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV | |
# ---------------------------------------------- | |
# Confirm we did, in fact, update the version | |
# ---------------------------------------------- | |
- 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 | |
echo "current_tag=refs/tags/${TAG}" >> $GITHUB_ENV | |
# ---------------------------------------------- | |
# Generate release notes | |
# ---------------------------------------------- | |
# - name: Release Notes | |
# run: git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s' --no-merges >> ".github/RELEASE-TEMPLATE.md" | |
- name: Export tag name to env variable | |
run: | | |
TAG=$(git describe HEAD --tags --abbrev=0) | |
echo "CURRENT_TAG=refs/tags/${TAG}" >> $GITHUB_ENV | |
- name: Get notes | |
id: generate_notes | |
uses: anmarkoulis/commitizen-changelog-reader@master | |
with: | |
tag_name: ${{ env.CURRENT_TAG }} | |
changelog: CHANGELOG.md | |
# ---------------------------------------------- | |
# Build draft release (Note: Will need to manually publish) | |
# ---------------------------------------------- | |
- name: Create Release Draft | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: ${{join(fromJson(steps.generate_notes.outputs.notes).notes, '')}} | |
draft: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |