Fix gh-action-sigstore-python version #37
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- name: Install build | |
run: pip install build | |
- name: Build distribution | |
run: python -m build . | |
- name: File list | |
run: tar tf dist/*.tar.gz && unzip -l dist/*.whl | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
test: | |
name: Run tests | |
needs: build | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-rc.1"] | |
os: [ubuntu-latest, macos-13, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Install wheel | |
shell: bash | |
run: pip install dist/*.whl | |
- name: Make it use package from wheel | |
shell: bash | |
run: rm flask_shell_ipython.py | |
- name: Install test requirements | |
run: pip install -r requirements-test.txt | |
- name: Test | |
if: runner.os != 'Windows' | |
run: pytest --forked | |
- name: Test (Windows) | |
if: runner.os == 'Windows' | |
shell: bash | |
run: pytest --collect-only -q | grep ^test_ | while read testname; do pytest -q $testname; done | |
pypi-publish-test: | |
name: Release on Test PyPI | |
needs: test | |
runs-on: ubuntu-latest | |
environment: | |
name: Test PyPI | |
url: "https://test.pypi.org/project/flask-shell-ipython/" | |
permissions: | |
id-token: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: "https://test.pypi.org/legacy/" | |
attestations: true | |
github-release: | |
name: Release on GitHub | |
needs: test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
environment: | |
name: GitHub | |
url: "https://github.com/ei-grad/flask-shell-ipython/releases/" | |
permissions: | |
contents: write # IMPORTANT: mandatory for making GitHub Releases | |
id-token: write # IMPORTANT: mandatory for sigstore | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Sign the dists with Sigstore | |
uses: sigstore/[email protected] | |
with: | |
inputs: >- | |
./dist/*.tar.gz | |
./dist/*.whl | |
- name: Create GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: >- | |
gh release create | |
'${{ github.ref_name }}' | |
--repo '${{ github.repository }}' | |
--generate-notes | |
- name: Upload artifact signatures to GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: >- | |
gh release upload | |
'${{ github.ref_name }}' dist/** | |
--repo '${{ github.repository }}' | |
pypi-publish: | |
name: Release on PyPI | |
needs: test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
environment: | |
name: PyPI | |
url: "https://pypi.org/project/flask-shell-ipython/" | |
permissions: | |
id-token: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
attestations: true |