Skip to content

Create Draft Release on new tag #1

Create Draft Release on new tag

Create Draft Release on new tag #1

Workflow file for this run

name: Create Draft Release on new tag
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build-package:
uses: ./.github/workflows/build-package.yml
autorelease:
name: Create Draft Release
needs: [build-package]
runs-on: "ubuntu-latest"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version of project
run: |
PROJECT_VERSION=$(grep -F "__version__ =" netbox_data_flows/__init__.py | cut -d\" -f2)
echo "Version from __init__.py: ${PROJECT_VERSION}"
echo "PROJECT_VERSION=${PROJECT_VERSION}" >> $GITHUB_ENV
- name: Create staging directory
run: mkdir dist
- name: Fetch build artifacts
uses: actions/download-artifact@v4
with:
name: distributions
path: dist/
- name: Prepare Release Notes
run: git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s' --no-merges >> ".github/RELEASE-TEMPLATE.md"
- name: Create Release Draft
uses: softprops/action-gh-release@v2
with:
body_path: ".github/RELEASE-TEMPLATE.md"
draft: true
files: |
dist/netbox_data_flows-${{env.PROJECT_VERSION}}.tar.gz
dist/netbox_data_flows-${{env.PROJECT_VERSION}}-py3-none-any.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}