-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.13 KB
/
create-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
name: "Create release"
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l -e -o pipefail {0}
steps:
- uses: actions/checkout@v4
- name: "Fetch Tags"
run: git fetch --tags --force
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: "x64"
- name: "Install Dependencies"
run: |
pip install --upgrade pip
pip install build
- name: "Build Package"
run: python -m build
- name: "Get release variables"
run: |
echo RELEASE_VERSION=$(git describe --always --tags --dirty) >> $GITHUB_ENV
echo MASTER_SHA=$(git rev-parse origin/master) >> $GITHUB_ENV
- name: "Create Release"
uses: ncipollo/[email protected]
with:
name: ${{ env.RELEASE_VERSION }}
prerelease: ${{ !(github.sha == env.MASTER_SHA) }}
artifacts: "dist/*.tar.gz"
removeArtifacts: true
artifactErrorsFailBuild: true
generateReleaseNotes: true