-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (43 loc) · 1.63 KB
/
release.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
name: Release
on:
# uncomment the following to only release on push to main
# this is not recommended as it will not release if the tests fail
# however it is faster and can be used for testing
push:
branches:
- main
# uncomment the following to only release on a successful workflow run
# this is recommended as it will only release if the tests pass
# this however cause you to test twice which might be not be ideal
# if you oncomment this
# workflow_run:
# workflows: ["Tests"]
# types:
# - completed
jobs:
release:
runs-on: ubuntu-latest
concurrency: release
# if the workflow run was successful and the branch is main:
# only uncomment this if you uncomment the workflow_run above
# if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/main' }}
# only uncomment this if you run on push to main
if: ${{ github.ref == 'refs/heads/main' }}
steps:
# Checkout action is required for token to persist
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.RELEASE }}
- name: Python Semantic Release
uses: relekang/[email protected]
with:
github_token: ${{ secrets.RELEASE }}
# Remember to copy the [semantic_release] section from pyproject.toml
# as well
# To enable pypi,
# 1) Set upload_to_pypi to true in pyproject.toml and
# 2) Set the pypi_token in the repo
# 3) Uncomment the two lines below
repository_username: __token__
repository_password: ${{ secrets.PYPI_API_TOKEN }}