-
Notifications
You must be signed in to change notification settings - Fork 12
57 lines (57 loc) · 1.63 KB
/
publish.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
name: publish
on:
push:
tags:
- "v*.*.*"
release:
types:
- published
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/flask_mab
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '>=3.10'
- name: Set up build deps
run: python -m pip install --upgrade build
- name: Install dependencies
run: python -m pip install '.[dev]'
- name: Run tests
run: tox
- name: Set commit time to release time
run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
- name: Build dist
run: python -m build .
- name: Build docs
uses: ammaraskar/[email protected]
with:
pre-build-command: python -m pip install '.[dev]'
docs-folder: "docs/"
build-command: sphinx-build -b html . _build
- name: Build Changelog
id: github_release
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: >-
dist/*
artifactErrorsFailBuild: true
allowUpdates: true
body: ${{steps.github_release.outputs.changelog}}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1