This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
84 lines (80 loc) · 2.42 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
76
77
78
79
80
81
82
83
84
name: 'push and release master'
on:
push:
branches:
- master
workflow_dispatch:
repository_dispatch:
types: cron_release
jobs:
build:
name: 'push and release'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
with:
ref: master
- uses: dorny/paths-filter@v3.0.2
id: code-changes
with:
filters: |
code_changes:
- 'osadl_matrix/**/*'
- 'osadl_matrix/*'
- 'LICENSE*'
- 'README.md'
- 'requirements.txt'
- 'MANIFEST.in'
- 'setup.py'
- 'VERSION'
- name: install dependencies
run: |
python3 -m pip install --upgrade pip build
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt
shell: bash
- name: lint
run: |
flake8
- name: build
run: python3 -m build --sdist --wheel
shell: bash
- name: test
run: |
pytest
shell: bash
- name: bump version
if: steps.code-changes.outputs.code_changes == 'true' || github.event_name == 'workflow_dispatch'
run: |
date --utc '+%Y.%m.%d.%H%m%S' | tr -d '\n' > VERSION
shell: bash
- name: push
if: steps.code-changes.outputs.code_changes == 'true' || github.event_name == 'workflow_dispatch'
uses: github-actions-x/commit@v2.9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'master'
commit-message: 'Bump version'
files: VERSION
name: ${{ secrets.COMMITER_NAME }}
email: ${{ secrets.COMMITER_MAIL }}
rebase: 'true'
- name: tag version
if: steps.code-changes.outputs.code_changes == 'true' || github.event_name == 'workflow_dispatch'
uses: butlerlogic/action-autotag@1.1.2
with:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
strategy: regex
root: "VERSION"
regex_pattern: '(.*)'
- name: create release
if: steps.code-changes.outputs.code_changes == 'true' || github.event_name == 'workflow_dispatch'
run: python3 -m build --sdist --wheel
shell: bash
- name: publish package
if: steps.code-changes.outputs.code_changes == 'true' || github.event_name == 'workflow_dispatch'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}