Merge pull request #48 from maxwell-k/renovate/qgridtrusted-0.x #530
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
# .github/workflows/nox.yaml | |
# Copyright 2023 Keith Maxwell | |
# SPDX-License-Identifier: CC0-1.0 | |
on: # yamllint disable-line rule:truthy | |
push: { branches: [main] } | |
pull_request: { branches: [main] } | |
schedule: [{ cron: "15 0 * * *" }] | |
workflow_dispatch: | |
inputs: | |
repository-url: | |
type: choice | |
description: Upload API endpoint for PyPI | |
options: | |
# https://github.com/pypa/gh-action-pypi-publish/blob/unstable/v1/action.yml#L23 | |
- https://upload.pypi.org/legacy/ | |
- https://test.pypi.org/legacy/ | |
default: https://upload.pypi.org/legacy/ | |
jobs: | |
nox: | |
runs-on: ubuntu-latest | |
outputs: { version: "${{ steps.version.outputs.version }}" } | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: { python-version: "3.11" } | |
id: setup | |
- run: pipx run "--python=${{ steps.setup.outputs.python-path }}" nox | |
- run: git diff --exit-code dist/SHA256SUMS | |
- run: >- | |
pipx run "--python=${{ steps.setup.outputs.python-path }}" | |
nox --session=github_output >> "$GITHUB_OUTPUT" | |
id: version | |
- uses: actions/upload-artifact@v4 | |
with: { path: dist } | |
- name: Upload wheelhouse/ to debug unexpected changes | |
uses: actions/upload-artifact@v4 | |
with: { name: wheelhouse, path: wheelhouse } | |
if: always() | |
- uses: dprint/check@v2.2 | |
publish: | |
needs: [nox] | |
runs-on: ubuntu-latest | |
if: "${{ github.event_name == 'workflow_dispatch' }}" | |
permissions: { id-token: write } | |
environment: | |
name: pypi | |
url: >- | |
https://${{ | |
contains(github.event.inputs.repository-url, 'test') && 'test.' || '' | |
}}pypi.org/project/reproducibly/${{ | |
needs.nox.outputs.version | |
}}/ | |
steps: | |
- name: Prevent deployments outside test from outside main | |
run: "false" | |
if: >- | |
${{ !( github.ref == 'refs/heads/main' | |
|| contains(github.event.inputs.repository-url, 'test')) }} | |
- uses: actions/download-artifact@v4 | |
with: { name: artifact } | |
- run: sha256sum -c SHA256SUMS | |
- run: rm SHA256SUMS | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
print-hash: true | |
packages-dir: . | |
repository-url: ${{ github.event.inputs.repository-url }} |