Skip to content

Commit

Permalink
Use Trusted Publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch committed Nov 13, 2024
1 parent 8873151 commit 820bf1c
Showing 1 changed file with 43 additions and 29 deletions.
72 changes: 43 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ on:
- v*
pull_request:

env:
UV_SYSTEM_PYTHON: 1

jobs:
metadata_please-just-tests:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: [macOS-latest, ubuntu-latest, windows-latest]
exclude:
# macOS-latest are now on arm64
- os: macOS-latest
python-version: "3.7"
# no amd64 3.7
- python-version: "3.7"
os: macOS-latest

steps:
- name: Checkout
Expand All @@ -29,35 +32,46 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@v3
- name: Install
run: |
python -m pip install --upgrade pip
pip install -U .
uv pip install -e .[test]
- name: Test
run: python -m metadata_please.tests

metadata_please:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: [macOS-latest, ubuntu-latest, windows-latest]
run: make test
- name: Lint
run: |
uv pip install -e .[test,dev]
make lint
if: ${{ matrix.python-version != '3.9' && matrix.python-version != '3.8' && matrix.python-version != '3.7' }}

build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "3.12"
- uses: astral-sh/setup-uv@v3
- name: Install
run: |
python -m pip install --upgrade pip
make setup
pip install -U .
- name: Test
run: make test
- name: Lint
run: make lint
run: uv pip install build
- name: Build
run: python -m build
- name: Upload
uses: actions/upload-artifact@v3
with:
name: sdist
path: dist

publish:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: sdist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 820bf1c

Please sign in to comment.