diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6cb0938 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +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: 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: + files: | + packages/${{ github.event.inputs.sdk }}/dist/*.whl + packages/${{ github.event.inputs.sdk }}/dist/*.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}