-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (41 loc) · 1.39 KB
/
prepare-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 }}