-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.82 KB
/
Copy pathcreate-python-release.yml
File metadata and controls
57 lines (54 loc) · 1.82 KB
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
49
50
51
52
53
54
55
56
57
name: Create Python Release
on:
workflow_dispatch:
inputs:
versionChoice:
type: choice
required: true
description: Version Change
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
create-release:
name: create new python release
runs-on: [self-hosted, linux, X64]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install GH CLI
uses: dev-hanz-ops/install-gh-cli-action@v0.2.1
- name: Create new version in pyproject.toml
run: poetry version $VERSION
working-directory: python
env:
VERSION: ${{ inputs.versionChoice }}
- name: Commit new version
run: |
git config --global user.email "code@starwit.de"
git config --global user.name "Starwit"
git remote set-url --push origin https://Starwit:$GITHUB_TOKEN@github.com/starwit/vision-lib.git
git add python/pyproject.toml
modifications=$(git status | grep "modified" || true)
if [ ! -z "$modifications" ]; then
echo "modifications found: $modifications"
git commit -m "modified project version" python/pyproject.toml
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
run: |
APP_VERSION=$(grep "^version" python/pyproject.toml | head -1 | cut -d'"' -f2)
gh release create "$APP_VERSION" --title "$APP_VERSION" --target "$(git branch --show-current)" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}