Skip to content

Fix open redirect with backslashes (#94) #17

Fix open redirect with backslashes (#94)

Fix open redirect with backslashes (#94) #17

Workflow file for this run

name: PyPI release 🐍 πŸ“¦
on:
push:
tags: [v*]
jobs:
build:
name: Build package πŸ“¦
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Set up Python 🐍
with:
python-version: '3.11'
- name: Check version πŸ”
run: python .github/utils/check_version.py "${GITHUB_REF#refs/tags/v}"
- name: Install build deps πŸ”§
run: pip install --user build
- name: Build wheel and sdist πŸ“¦
run: >-
python -m
build
--outdir dist/
.
- uses: actions/upload-artifact@v4
name: Upload build artifacts πŸ“¦
with:
name: wheel
retention-days: 7
path: ./dist
create-github-release:
name: Create GitHub release πŸ™
# Upload wheel to a GitHub release. It remains available as a build artifact for a while as well.
needs: build
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
name: Download build artifacts πŸ“¦
- name: Create draft release πŸ™
run: >-
gh release create
--draft
--repo ${{ github.repository }}
--title ${{ github.ref_name }}
${{ github.ref_name }}
wheel/*
env:
GH_TOKEN: ${{ github.token }}
publish-pypi:
name: Publish πŸš€
needs: build
# Wait for approval before attempting to upload to PyPI. This allows reviewing the
# files in the draft release.
environment: publish
runs-on: ubuntu-22.04
permissions:
contents: write
id-token: write
steps:
- uses: actions/download-artifact@v4
# Try uploading to Test PyPI first, in case something fails.
- name: Publish to Test PyPI πŸ§ͺ
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: wheel/
- name: Publish to PyPI πŸš€
uses: pypa/[email protected]
with:
packages-dir: wheel/
- name: Publish GitHub release πŸ™
run: >-
gh release edit
--draft=false
--repo ${{ github.repository }}
${{ github.ref_name }}
env:
GH_TOKEN: ${{ github.token }}