Skip to content

Commit

Permalink
autopublish
Browse files Browse the repository at this point in the history
  • Loading branch information
mjschultz committed Nov 1, 2024
1 parent cda4808 commit 1389e7d
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -31,19 +29,36 @@ jobs:
run: |
flake8 gcp_flowlogs_reader tests
- name: Check formatting with black
if: "matrix.python-version == '3.8'"
if: "matrix.python-version == '3.11'"
run: |
pip install -U black
black --check .
- name: Build packages
if: "matrix.python-version == '3.8'"
if: "matrix.python-version == '3.11'"
run: |
pip install -U twine wheel
python setup.py sdist bdist_wheel
twine check dist/*
- name: Upload packages
if: "matrix.python-version == '3.8'"
if: "matrix.python-version == '3.11'"
uses: actions/upload-artifact@v4
with:
name: gcp-flowlogs-reader-packages
path: dist/*

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs:
- build
permissions:
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: gcp-flowlogs-reader-packages
path: dist/
- name: Upload packages to PyPi
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 1389e7d

Please sign in to comment.