-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.44 KB
/
release.yml
File metadata and controls
51 lines (49 loc) · 1.44 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
name: Release
on:
release:
types:
- published
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install PyPi Release Dependencies
run: |
pip install -U pip setuptools wheel twine build
- name: Build Package
run: |
python -m build
- name: Get tag
id: get-tag
run: |
echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
if [ "x${{ secrets.PYPI_TOKEN }}" == "x" ]; then
echo "has_pypi_token=no" >> $GITHUB_OUTPUT
else
echo "has_pypi_token=yes" >> $GITHUB_OUTPUT
fi
- name: PyPi Release
id: pypi-release
if: ${{ steps.get-tag.outputs.has_pypi_token == 'yes' }}
run: |
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
python -m twine upload dist/*
- name: GitHub Release
uses: "marvinpinto/action-automatic-releases@4edd7a5aabb1bc62e6dc99b3302d587bf3134e20"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.get-tag.outputs.tag }}"
prerelease: false
title: "${{ steps.pypi-release.outputs.tag }}"
files: |
dist/*