Skip to content

Commit

Permalink
Chore:Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AtticusZeller authored Jan 11, 2024
1 parent e1ad025 commit a405374
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,63 @@ on:
workflow_dispatch:

jobs:
test-and-changelog:
name: Test and Generate Changelog / OS ${{ matrix.os }} / Python ${{ matrix.python-version }}
test:
name: Run Tests / OS ${{ matrix.os }} / Python ${{ matrix.python-version }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Clone Repository
uses: actions/checkout@v4
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.7.1

- name: Python Semantic Release (Generate Changelog)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Tests
run: poetry run tests

- name: Upload Coverage
uses: codecov/codecov-action@v1


changelog:
name: Generate Changelog
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Clone Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.ATTICUS_PAT }}

- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

publish:
needs: test-and-changelog
if: github.event.pull_request.merged == true
name: Publish to GitHub Releases
runs-on: ubuntu-latest
name: "Publish to GitHub Releases"
needs: changelog
if: github.event.pull_request.merged == true
steps:
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
token: ${{ secrets.ATTICUS_PAT }}

- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a405374

Please sign in to comment.