-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (79 loc) · 2.26 KB
/
build.yaml
File metadata and controls
92 lines (79 loc) · 2.26 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
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
85
86
87
88
89
90
91
92
name: Build & Test
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'
- 'lib/**'
pull_request:
branches: [ main ]
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'
- 'lib/**'
jobs:
build:
name: Build and test, Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9' ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install poetry
shell: bash
run: pip install poetry
- name: Install project
run: |
poetry install
- name: Test
run: |
poetry run pytest
- name: Get version
id: get_version
run: |
echo "version=$(poetry version --short)" >> "$GITHUB_OUTPUT"
- name: Build
run: |
poetry build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: openxes_cli_py-py${{ matrix.python-version }}-${{ steps.get_version.outputs.version }}
path: dist
- name: Generate changelog
run: |
echo "# Changelog" > CHANGELOG.md
echo "" >> CHANGELOG.md
echo "\`\`\`" >> CHANGELOG.md
git log --pretty=format:"%h - %s (%an)" $(git describe --tags --abbrev=0)..HEAD >> CHANGELOG.md
echo "" >> CHANGELOG.md
echo "\`\`\`" >> CHANGELOG.md
if: github.ref == 'refs/heads/main'
- name: Assign repository tag
run: |
git tag ${{ steps.get_version.outputs.version }}
git push --tags
if: github.ref == 'refs/heads/main'
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
tag_name: ${{ steps.get_version.outputs.version }}
body_path: CHANGELOG.md
if: github.ref == 'refs/heads/main'
- name: Publish to PyPI
run: |
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
if: github.ref == 'refs/heads/main'