Skip to content

Commit 7ff87e8

Browse files
Release yml - GitHub actions (#3)
1 parent 2664b5e commit 7ff87e8

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Semantic Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseType:
7+
description: "version update type"
8+
required: true
9+
type: choice
10+
default: "automatic"
11+
options:
12+
- "automatic"
13+
- "major"
14+
- "minor"
15+
- "patch"
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
concurrency: release
21+
permissions:
22+
id-token: write
23+
contents: write
24+
25+
environment:
26+
name: pypi
27+
url: https://pypi.org/p/genai-monitor
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Python Semantic Release Manual
35+
id: release_manual
36+
if: ${{ github.event.inputs.releaseType != 'automatic' }}
37+
uses: python-semantic-release/python-semantic-release@master
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
force: ${{ github.event.inputs.releaseType }}
41+
changelog: false
42+
43+
- name: Python Semantic Release Automatic
44+
id: release_automatic
45+
if: ${{ github.event.inputs.releaseType == 'automatic' }}
46+
uses: python-semantic-release/python-semantic-release@master
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
changelog: false
50+
51+
52+
- name: Publish package distributions to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1
54+
55+
if: steps.release_manual.outputs.released == 'true' || steps.release_automatic.outputs.released == 'true'

0 commit comments

Comments
 (0)