-
Notifications
You must be signed in to change notification settings - Fork 6
90 lines (78 loc) · 2.33 KB
/
release-batch.yaml
File metadata and controls
90 lines (78 loc) · 2.33 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release Batch SDK
on:
push:
tags:
- "batch/v*"
permissions:
contents: read
id-token: write
jobs:
extract-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract.outputs.version }}
steps:
- name: Extract version from tag
id: extract
run: |
# Extract version from tag (batch/v1.0.0 -> 1.0.0)
VERSION=${GITHUB_REF#refs/tags/batch/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
test-batch:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Test Batch SDK
run: |
make install-dev
make lint-batch
make test-batch
release-build:
runs-on: ubuntu-latest
needs: [extract-version, test-batch]
outputs:
version: ${{ needs.extract-version.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Update package version in sdk/batch/speechmatics/batch/__init__.py
run: |
VERSION="${{ needs.extract-version.outputs.version }}"
sed -i "s/0\.0\.0/$VERSION/g" ./sdk/batch/speechmatics/batch/__init__.py
echo "Updated version to: $VERSION"
cat ./sdk/batch/speechmatics/batch/__init__.py | grep __version__
- name: Build Batch SDK
run: |
make install-dev
make build-batch
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: batch-release-dist
path: sdk/batch/dist/
pypi-publish:
runs-on: ubuntu-latest
needs: [release-build]
environment:
name: pypi-batch
url: https://pypi.org/project/speechmatics-batch/${{ needs.release-build.outputs.version }}
steps:
- name: Retrieve release dist
uses: actions/download-artifact@v4
with:
name: batch-release-dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
password: ${{ secrets.PYPI_ORG_TOKEN }}