diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7994012..78afc85 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -46,20 +46,23 @@ jobs: echo "VERSION" echo "CHANGELOG" + external-build-workflow: + uses: ./.github/workflows/build.yml + with: + CIBW_SKIP: "pp* cp36-* cp37-*" + CIBW_BUILD: "cp*-macosx* cp*-manylinux*" + secrets: inherit + release-python-package: - needs: update-version-and-changelog + needs: [external-build-workflow, update-release-github, update-version-and-changelog] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 with: - ref: ${{ github.ref_name }} - - name: Setup Python 3.11 - uses: actions/setup-python@v4 + name: artifact # if `name: artifact` is omitted, the action will create extra parent dir + path: dist + # TODO: Trusted publishing + - uses: pypa/gh-action-pypi-publish@release/v1 with: - python-version: 3.11 - cache: 'pip' # caching pip dependencies - - name: Build python package - run: | # TODO: build so file? - python -m pip install wheel build twine - python -m pip wheel . --no-deps --wheel-dir dist - python -m twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* + password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ff1f1f..4840591 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,6 @@ jobs: # run: python -m mypy codebleu external-build-workflow: - name: Call wheel and sdist build workflow uses: ./.github/workflows/build.yml with: CIBW_SKIP: "pp* cp36-* cp37-*" @@ -39,6 +38,7 @@ jobs: secrets: inherit test-python: + needs: [external-build-workflow] strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] @@ -46,14 +46,11 @@ jobs: fail-fast: false name: Test wheel on ${{ matrix.os }} and Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} - needs: [external-build-workflow] steps: - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 with: - # unpacks default artifact into dist/ - # if `name: artifact` is omitted, the action will create extra parent dir - name: artifact + name: artifact # if `name: artifact` is omitted, the action will create extra parent dir path: dist - name: Show dist files run: ls -lah ./dist @@ -67,7 +64,7 @@ jobs: # force install package from local dist directory # TODO: check the sdist package is not installed rm -rf ./dist/*.tar.gz - pip install --update --no-deps --no-index --find-links=./dist codebleu + pip install --upgrade --no-deps --no-index --find-links=./dist codebleu # install dependencies for the package and tests pip install .[test] - name: Test itself