-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.18 KB
/
build-and-release.yaml
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
---
name: Build & Release
permissions: {}
on: # yamllint disable-line rule:truthy
push:
paths-ignore:
- "*.md"
pull_request:
paths-ignore:
- "*.md"
jobs:
build_and_release:
runs-on: ubuntu-latest
concurrency: release
permissions:
contents: write
packages: write
statuses: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Release
uses: python-semantic-release/python-semantic-release@v9.8.5
id: release
if: github.ref_name == 'main'
with:
changelog: "false"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ env.PYPI_TOKEN }}
if: steps.release.outputs.released == 'true'
- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@v9.8.5
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}