-
Notifications
You must be signed in to change notification settings - Fork 32
45 lines (43 loc) · 1.31 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
name: Release SDK if needed
on:
pull_request:
branches: main
types: closed
jobs:
release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.head.ref, 'release/')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Build the package
run: poetry build
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create Release tag
id: create-tag
env:
PR_REF: ${{ github.event.pull_request.head.ref }}
run: |
release_tag=$(echo "$PR_REF" | cut -d "/" -f2)
echo "::set-output name=release-tag::$release_tag"
- name: Make new release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.create-tag.outputs.release-tag }}
commit: main
body: ${{ github.event.pull_request.body }}