Skip to content

Commit

Permalink
👷 Add GitHub Funding and CI/CD workflow files
Browse files Browse the repository at this point in the history
Set up GitHub-specific configuration files

- Add FUNDING.yml to configure sponsorship options
- Implement CI/CD workflow with ci-cd.yml
  • Loading branch information
hyperb1iss committed Sep 10, 2024
1 parent 784b375 commit 212045b
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/gh/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: hyperb1iss
ko_fi: hyperb1iss
69 changes: 69 additions & 0 deletions .github/gh/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI/CD

on:
push:
branches: [ main ]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Run tests
run: poetry run pytest
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test-results

create-release:
needs: [build-and-test]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

release:
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install poetry
poetry install
- name: Build package
run: poetry build
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish

0 comments on commit 212045b

Please sign in to comment.