diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 81d24f5..3935055 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -41,7 +41,7 @@ jobs: name: dist path: dist - name: Push docs - uses: opendp/tumult-tools/actions/push_docs@1c7b4b3cfa98ab75f3c5b0b91858c897a81629ad + uses: opendp/tumult-tools/actions/push_docs@df58d56705007d8b7ad1b66280df7465afa15a49 with: docs-repository: opendp/tumult-docs docs-repository-token: ${{ secrets.DOCS_REPO_PAT }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 302dfe9..486ce91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,4 +135,74 @@ jobs: path: dist - run: uv run nox -s "test_dependency_matrix(${{matrix.python}}-${{matrix.dependencies}})" env: - SPARK_LOCAL_HOSTNAME: localhost \ No newline at end of file + SPARK_LOCAL_HOSTNAME: localhost + + Publish-To-PyPI: + if: github.repository == 'opendp/tumult-core' + runs-on: ubuntu-latest + needs: + - Test-Slow + - Benchmark + - Dependency-Matrix + - Package-linux + - Package-macos-arm + - Package-macos-intel + environment: + name: pypi + url: https://pypi.org/p/tmlt-core + permissions: + id-token: write + steps: + - name: Download linux wheel + uses: actions/download-artifact@v4 + with: + name: linux-wheel + path: dist + - name: Download mac arm wheel + uses: actions/download-artifact@v4 + with: + name: macos-arm-wheel + path: dist + - name: Download mac intel wheel + uses: actions/download-artifact@v4 + with: + name: macos-intel-wheel + path: dist + - name: Download sdist + uses: actions/download-artifact@v4 + with: + name: sdist + path: dist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + Push-Docs: + if: ${{ github.repository == 'opendp/tumult-core' + && ! contains(github.ref_name, 'alpha') + && ! contains(github.ref_name, 'beta') + && ! contains(github.ref_name, 'rc') }} + runs-on: ubuntu-latest + environment: docs-push + needs: Publish-To-PyPI + steps: + - name: Checkout code repository + uses: actions/checkout@v4 + - name: Set up runner + uses: opendp/tumult-tools/actions/setup@eabe1054863f0916a0087ad180fd83719049c094 + - name: Download dist + uses: actions/download-artifact@v4 + with: + name: linux-wheel + path: dist + - run: | + re="^([0-9]+)\.([0-9]+).*$" + [[ $GITHUB_REF_NAME =~ $re ]] + echo "MAJOR_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV + echo "MINOR_VERSION=${BASH_REMATCH[2]}" >> $GITHUB_ENV + - name: Push docs + uses: opendp/tumult-tools/actions/push_docs@df58d56705007d8b7ad1b66280df7465afa15a49 + with: + docs-repository: opendp/tumult-docs + docs-repository-token: ${{ secrets.DOCS_REPO_PAT }} + docs-path: docs/core + version: ${{ format('v{0}.{1}', env.MAJOR_VERSION, env.MINOR_VERSION) }}