diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0660413..8ce4f2c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,8 @@ name: Deploy Documentation +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + on: push: branches: [ master ] diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..d92debb --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,57 @@ +name: Publish to PyPI + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: Build distribution artifacts + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install build tooling + run: python -m pip install --upgrade build + + - name: Build sdist and wheel + run: python -m build + + - name: Upload distribution artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + publish: + name: Publish package to PyPI + needs: build + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + environment: + name: pypi + url: https://pypi.org/p/musicalgestures + steps: + - name: Download distribution artifacts + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - name: Publish to PyPI via trusted publishing + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index b213723..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Run Test with Pytest - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - - steps: - - uses: actions/checkout@v6 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - - name: Update documentation files - run: | - pip install handsdown==1.1.0 - handsdown --external https://github.com/fourMs/MGT-python --branch master - - - uses: stefanzweifel/git-auto-commit-action@v7 - with: - commit_message: Update documentation - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install FFmpeg and FFprobe - uses: FedericoCarboni/setup-ffmpeg@v3 - id: setup-ffmpeg - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - - name: Install musicalgestures - shell: bash -l {0} - run: python -m pip install musicalgestures - - - name: Lint with Ruff - run: | - pip install ruff - ruff --output-format=github - continue-on-error: true - - ########## TODO ############ - # - name: Test with pytest - # shell: bash -l {0} - # run: | - # pip install pytest - # python -m pytest -v \ No newline at end of file