-
Notifications
You must be signed in to change notification settings - Fork 4
80 lines (66 loc) 路 2.62 KB
/
Copy pathrelease.yml
File metadata and controls
80 lines (66 loc) 路 2.62 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
name: Manual SDK Release
on:
workflow_dispatch:
inputs:
sdk:
description: 'SDK name (e.g., auth0_server_python)'
required: true
version:
description: 'Version (e.g., 1.0.0b1). Leave blank to read from pyproject.toml.'
required: false
jobs:
release:
name: Release ${{ github.event.inputs.sdk }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Add Poetry to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Get version from pyproject.toml
id: get_version
run: |
cd packages/${{ github.event.inputs.sdk }}
if [ -z "${{ github.event.inputs.version }}" ]; then
VERSION=$(poetry version -s)
else
VERSION="${{ github.event.inputs.version }}"
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Install dependencies
working-directory: packages/${{ github.event.inputs.sdk }}
run: poetry install --no-root
- name: Run tests with pytest
working-directory: packages/${{ github.event.inputs.sdk }}
run: |
poetry run pytest -v --cov=src --cov-report=term-missing --cov-report=xml
- name: Build package
working-directory: packages/${{ github.event.inputs.sdk }}
run: poetry build
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.sdk }}-v${{ steps.get_version.outputs.version }}
name: "${{ github.event.inputs.sdk }} v${{ steps.get_version.outputs.version }}"
body: |
Version: `${{ steps.get_version.outputs.version }}`
(https://github.com/${{ github.repository }}/tree/main/packages/${{ github.event.inputs.sdk }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build artifacts
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.sdk }}-v${{ steps.get_version.outputs.version }}
name: "${{ github.event.inputs.sdk }} v${{ steps.get_version.outputs.version }}"
files: |
packages/${{ github.event.inputs.sdk }}/dist/*.whl
packages/${{ github.event.inputs.sdk }}/dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}