Skip to content

Commit

Permalink
Merge branch 'main' into fix/music-box-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Aug 13, 2024
2 parents a5a0e2c + e06393a commit c50b8dc
Show file tree
Hide file tree
Showing 54 changed files with 3,828 additions and 8,228 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/CI_Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ jobs:
cache: 'pip'

- name: Install dependencies
run: python -m pip install --upgrade pip
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install this package
run: pip install -e .

- name: Run pytest
run: cd tests && pytest

- name: Run the smoke tests
run: |
music_box configFile=tests/configs/analytical_config/my_config.json outputDir=tests/configs/analytical_config
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/pep8_autoformat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Pep8

on:
push:
branches:
- main

jobs:
autopep8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: autopep8
uses: peter-evans/autopep8@v2
with:
args: --recursive --in-place --aggressive --aggressive .

- name: Check for changes
id: check-changes
run: git diff --exit-code
continue-on-error: true

- name: Commit and push changes
# a failue of this step means changes were detected
if: steps.check-changes.outcome != 'success'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git commit -am "Auto-format code using Clang-Format" || echo "No changes to commit"
- name: Push changes to main-autopep8 branch
if: steps.check-changes.outcome != 'success'
run: git push origin HEAD:main-autopep8

- name: Create Pull Request
if: steps.check-changes.outcome != 'success'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Auto-format code using autopep8"
title: "Auto-format code by autopep8"
body: "This is an auto-generated PR with fixes by autopep8."
branch: main-autopep8
66 changes: 40 additions & 26 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,49 @@
name: Publish a pypi package
name: Publish Python Package

on:
workflow_dispatch:
release:
types: [created]
types:
- published

jobs:
publish_to_pypi:
build_sdist:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Check metadata
run: pipx run twine check dist/*

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

upload_all:
name: Upload release
needs: [build_sdist]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/acom_music_box
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build and publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pipx run build
pipx run twine check dist/*
python -m twine upload --repository pypi dist/*
- uses: actions/setup-python@v5
with:
python-version: "3.x"

- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading

0 comments on commit c50b8dc

Please sign in to comment.