-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (29 loc) · 928 Bytes
/
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
name: Build and Release
on:
push:
branches:
- main
jobs:
build-and-release:
if: contains(github.event.head_commit.message, 'release')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Hatch
run: pip install hatch
- name: Build
run: hatch build
- name: Create a Release
run: |
VERSION=$(cat pyproject.toml | grep version | cut -d'"' -f2)
RELEASE_DATE=$(date +'%Y-%m-%d')
RELEASE_TITLE="Release ${VERSION} (${RELEASE_DATE})"
gh release create "${VERSION}" dist/* -t "${RELEASE_TITLE}" --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload built package as artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/