-
-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (36 loc) · 1.13 KB
/
publish.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
name: Build and Publish
on:
push:
tags:
- '*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
container:
image: python:3.11-buster
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Extract tag version and update pyproject.toml
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/}
echo "Extracted version: ${{ github.ref_name }}"
sed -i "s/^version = .*/version = '${{ github.ref_name }}'/" pyproject.toml
- name: Install dependencies
run: |
pip install build twine
- name: Set execute permission for build.sh and dist.sh
run: |
chmod +x ./scripts/build.sh
chmod +x ./scripts/dist.sh
- name: Run build script
run: bash ./scripts/build.sh
- name: Run distribution script
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: bash ./scripts/dist.sh
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: ./dist/tessie_api-${{ github.ref_name }}.tar.gz