-
Notifications
You must be signed in to change notification settings - Fork 32
47 lines (44 loc) · 1.18 KB
/
python-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
47
# Python Release
#
# Automatically build and publish the package from the supported Python 3.x version.
#
name: release
on:
push:
tags:
- 'v*.*.*'
- 'v*.*'
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python: [3.7]
name: Python ${{ matrix.python }} ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Get Tag
id: tag
run: |
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- name: Set Version
run: |
sed -ri 's/version = "(.*)"/version = "${{ steps.tag.outputs.version }}"/' pyproject.toml
sed -i 's/"dev"/"${{ steps.tag.outputs.version }}"/' src/texturize/__init__.py
- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
activate-conda: true
python-version: ${{ matrix.python }}
- name: Install Requirements
run: |
pip install poetry invoke
- name: Create Package
run: |
poetry build
- name: Publish Package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish -n