diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..cf85a41 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,65 @@ +name: PyPI + +on: + push: + #tags: + # - v* + +jobs: + #publish-to-pypi: + # name: Publish to PyPI + # #if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + # if: false + # runs-on: ubuntu-latest + # needs: + # - build-wheels + # environment: + # name: pypi + # url: https://pypi.org/p/hogpp # Replace with your PyPI project name + # permissions: + # id-token: write # IMPORTANT: mandatory for trusted publishing + + # steps: + # - name: Download artifacts + # uses: actions/download-artifact@v4 + # with: + # name: python-package-distributions + # path: | + # dist/ + # wheelhouse/ + + # - name: Publish to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + + sign: + name: Sign packages + needs: + #- publish-to-pypi + - build-sdist + runs-on: ubuntu-latest + permissions: + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: | + dist/ + wheelhouse/ + + - name: Sign packages with Sigstore + uses: sigstore/gh-action-sigstore-python@v3.0.0 + with: + inputs: >- + dist/*.tar.gz + wheelhouse/*.whl + + #- name: Upload artifact signatures + # env: + # GITHUB_TOKEN: ${{ github.token }} + # run: >- + # gh release upload '${{ github.ref_name }}' + # dist/** wheelhouse/** + # --repo '${{ github.repository }}' diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 6d2bf4c..a9356ef 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,9 +1,21 @@ name: Wheels -on: [push, pull_request] +on: + push: + #paths-ignore: + # - '.clang-format' + # - '.dockerignore' + # - '.gitignore' + # - 'docs/**' + # - 'scripts/**' + # - 'tests/cpp/**' + # - 'workflow/**' + #tags: + # - v* jobs: - build_wheels: + build-wheels: + if: false name: Build wheels on ${{matrix.os}} runs-on: ${{matrix.os}} strategy: @@ -43,3 +55,30 @@ jobs: with: name: cibw-wheels-${{matrix.os}}-${{strategy.job-index}} path: ./wheelhouse/*.whl + + build-sdist: + name: Build sdist + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.13 + cache: 'pip' + cache-dependency-path: requirements.txt + + - name: Setup Dependencies + run: | + pip install -r requirements.txt + + - name: Build + run: | + pipx run build --sdist --verbose + + - uses: actions/upload-artifact@v4 + with: + name: sdist-${{strategy.job-index}} + path: ./dist/*.tar.gz