Skip to content

Commit

Permalink
[ci] a couple of updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gipert committed Feb 6, 2024
1 parent b427b3b commit aab7cc1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,47 @@ name: distribute

on:
workflow_dispatch:
pull_request:
push:
tags: "v*"
branches:
- main
release:
types:
- published

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 3

jobs:
dist:
name: Distribution build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build SDist and wheel
run: pipx run build

- uses: actions/upload-artifact@v4
with:
path: dist/*

- name: Check metadata
run: pipx run twine check dist/*
- uses: hynek/build-and-inspect-python-package@v2

publish:
needs: [dist]
name: Publish to PyPI
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v4
with:
name: artifact
name: Packages
path: dist

- uses: pypa/gh-action-pypi-publish@v1.8.11
with:
password: ${{ secrets.pypi_password }}
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.action == 'published'
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
name: leds

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- "releases/**"
pull_request:
merge_group:
release:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 3

jobs:
build-and-test:
name: Test leds with Python
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, macOS-latest]

steps:
Expand All @@ -29,13 +31,13 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get dependencies and install the leds
- name: Get dependencies and install leds
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade .[test]
- name: Run unit tests
run: |
pytest
python -m pytest
build-docs:
name: Build documentation
Expand Down

0 comments on commit aab7cc1

Please sign in to comment.