-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (40 loc) · 1.18 KB
/
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
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install poetry
run: |
python -m pip install poetry
- name: Extract Project VERSION
run: |
echo "PROJECT_VERSION=$(poetry version --short)" >> $GITHUB_ENV
- name: Check if tag version matches project version
run: |
TAG=$(git describe HEAD --tags --abbrev=0)
if [[ "$TAG" != "v$PROJECT_VERSION" ]]; then exit 1; fi
- name: Create Release Note
run: |
git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an <%ae>' --no-merges >> ".github/RELEASE-NOTE.md"
- name: Create Package
run: |
poetry build
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: ".github/RELEASE-NOTE.md"
draft: true
files: |
dist/pynamodb-encoder-${{ env.PROJECT_VERSION }}.tar.gz
dist/pynamodb_encoder-${{ env.PROJECT_VERSION }}-py3-none-any.whl