Skip to content

Commit 755fa0e

Browse files
Merge pull request #6 from auth0/cicd/release_workflow
Manual Release Workflow
2 parents d623091 + 1c0bb72 commit 755fa0e

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Manual SDK Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
sdk:
7+
description: 'SDK name (e.g., auth0_server_python)'
8+
required: true
9+
version:
10+
description: 'Version (e.g., 1.0.0b1). Leave blank to read from pyproject.toml.'
11+
required: false
12+
13+
jobs:
14+
release:
15+
name: Release ${{ github.event.inputs.sdk }}
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repo
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.10'
26+
27+
- name: Install Poetry
28+
run: curl -sSL https://install.python-poetry.org | python3 -
29+
30+
- name: Add Poetry to PATH
31+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
32+
33+
- name: Get version from pyproject.toml
34+
id: get_version
35+
run: |
36+
cd packages/${{ github.event.inputs.sdk }}
37+
if [ -z "${{ github.event.inputs.version }}" ]; then
38+
VERSION=$(poetry version -s)
39+
else
40+
VERSION="${{ github.event.inputs.version }}"
41+
fi
42+
echo "VERSION=$VERSION" >> $GITHUB_ENV
43+
echo "version=$VERSION" >> $GITHUB_OUTPUT
44+
45+
- name: Install dependencies
46+
working-directory: packages/${{ github.event.inputs.sdk }}
47+
run: poetry install --no-root
48+
49+
- name: Build package
50+
working-directory: packages/${{ github.event.inputs.sdk }}
51+
run: poetry build
52+
53+
- name: Create GitHub Release
54+
uses: softprops/action-gh-release@v1
55+
with:
56+
tag_name: ${{ github.event.inputs.sdk }}-v${{ steps.get_version.outputs.version }}
57+
name: "${{ github.event.inputs.sdk }} v${{ steps.get_version.outputs.version }}"
58+
body: |
59+
Version: `${{ steps.get_version.outputs.version }}`
60+
61+
(https://github.com/${{ github.repository }}/tree/main/packages/${{ github.event.inputs.sdk }})
62+
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Upload build artifacts
67+
uses: softprops/action-gh-release@v1
68+
with:
69+
files: |
70+
packages/${{ github.event.inputs.sdk }}/dist/*.whl
71+
packages/${{ github.event.inputs.sdk }}/dist/*.tar.gz
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)