-
Notifications
You must be signed in to change notification settings - Fork 18
48 lines (41 loc) · 1.43 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
43
44
45
46
47
48
# Create a release using the version number from the Python package
#
# This workflow is designed to create a GitHub release whenever a pull request
# is merged to the main branch that updates the version number for this repo's
# Python package.
#
# The release is created with the tag and name of the version number.
#
# If there already exists a tag for the package version number the release
# should not be created.
name: Create a GitHub release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Get package version
id: package_version
run: echo "::set-output name=python::"$(python setup.py --version)
- name: Check if version tag already exists
id: version_tag
uses: mukunku/tag-exists-action@78009d2b13e10ba051fe68d8d2f6778a9b2adab3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ steps.package_version.outputs.python }}
- name: Create GitHub release
if: ${{ steps.version_tag.outputs.exists == 'false' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.DM_GITHUB_TOKEN }}
with:
tag_name: ${{ steps.package_version.outputs.python }}
release_name: Release v${{ steps.package_version.outputs.python }}