forked from fortaia/test_core_github
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (62 loc) · 2.15 KB
/
release.yaml
File metadata and controls
65 lines (62 loc) · 2.15 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Release
on:
push:
tags: ['v*']
defaults:
run:
shell: bash
jobs:
draft-release:
name: Create draft release
strategy:
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.9" ]
runs-on: "${{ matrix.os }}"
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup uv
id: setup-uv
uses: astral-sh/setup-uv@v4
with:
version: "0.5.21"
python-version: ${{ matrix.python-version }}
- name: Setup PDM
uses: pdm-project/setup-pdm@v4.1
with:
python-version: ${{ matrix.python-version }}
- name: Generate pdm.lock
# Required for building the locked version of the package
# with pdm-build-locked (see pyproject.toml)
run: |
pdm lock --group :all --strategy inherit_metadata
- name: Add version to environment
run: |
PROJECT_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
- name: Build package for PyPI
run: |
uv build
- name: Generate Release Notes
run: |
echo "" >> ".github/release_template.md"
echo "## Changelog" >> ".github/release_template.md"
echo "" >> ".github/release_template.md"
uv add typer
uv run python scripts/changelog-to-release-template.py >> ".github/release_template.md"
echo "" >> ".github/release_template.md"
echo "## Changes" >> ".github/release_template.md"
echo "" >> ".github/release_template.md"
git log $(git describe --tags --abbrev=0 HEAD^)..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"
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
draft: true
files: |
dist/test_fork-${{ env.PROJECT_VERSION }}-py3-none-any.whl
dist/test_fork-${{ env.PROJECT_VERSION }}.tar.gz