-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (64 loc) · 1.96 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
72
73
74
75
---
# yamllint disable rule:line-length
name: Push action
on:
push:
branches:
- master
jobs:
test:
uses: ./.github/workflows/test.yml
release:
name: Bump version and create draft release
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
concurrency:
group: release
steps:
- name: Checkout repository
uses: actions/checkout@v4
if: ${{ !env.ACT }} # skip during local actions testing
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
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 == 'metis-science/pytopas'
uses: commitizen-tools/commitizen-action@4498afe6f2f1c5993fb29f22db7b597538c00aae
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
changelog_increment_filename: .CHANGELOG-CURRENT.md
push: true
commit: true
- name: Print new version
if: github.repository == 'metis-science/pytopas'
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
- name: Build
run: make dist
- 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@c9b46fe7aad9f02afd89b12450b780f52dacfb2d
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/*