-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (61 loc) · 1.89 KB
/
push.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
# yamllint disable rule:line-length
name: Push action
on:
push:
branches:
- master
jobs:
release:
name: Bump version and create draft release
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: release
steps:
- name: Checkout repository
uses: actions/checkout@v3
if: ${{ !env.ACT }} # skip during local actions testing
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[release]
- name: Create bump and changelog
id: cz
if: github.repository == 'tilde-lab/yascheduler'
uses: commitizen-tools/commitizen-action@e41bf7f2029bc8175af362badd6fd0860a329b0f
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
changelog_increment_filename: .CHANGELOG-CURRENT.md
push: true
commit: true
- name: Print new version
if: github.repository == 'tilde-lab/yascheduler'
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
- name: Build
run: flit build
- name: Stop if no bump
id: no-bump
continue-on-error: true
# will fail if not on exact tag
run: git describe --tags --exact-match
- name: Create Release Draft
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
if: steps.no-bump.outcome == 'success'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
tag_name: v${{ steps.cz.outputs.version }}
body_path: .CHANGELOG-CURRENT.md
fail_on_unmatched_files: true
files: dist/*