From 511ec3fee56801d12d3589090f006c9ca1094557 Mon Sep 17 00:00:00 2001 From: Ken Brewer Date: Tue, 20 Feb 2024 14:40:42 +0000 Subject: [PATCH] ci: add versioned artifact build action This adds a versioned code artifact to the ci pipeline that can be used during other actions and in Github releases. --- .github/workflows/integration-test.yml | 41 ++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 9c7f2987..1f3b55d6 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -38,8 +38,7 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 with: - # Full history likely required for planned commitizen checks - # See #345 + # Full history required for branch-based pre-commit checks fetch-depth: 0 - name: Setup python, and check pre-commit cache uses: ./.github/actions/setup-env @@ -105,3 +104,41 @@ jobs: # For every other version and/or OS, run pytest without coverage if: (matrix.os != 'ubuntu-latest') || (matrix.python-version != env.TARGET_PYTHON_VERSION ) run: poetry run pytest ${{ github.event.inputs.pytest_addopts }} + build: + name: Build versioned package + # This job is used to build the package and upload the artifacts + runs-on: ubuntu-latest + outputs: + version: ${{ steps.get_version.outputs.version }} + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup python, and load cache + uses: ./.github/actions/setup-env + with: + python-version: ${{ env.TARGET_PYTHON_VERSION }} + cache-pre-commit: false + cache-venv: true + setup-poetry: true + install-deps: true + - name: Build + run: poetry build + - name: Get pycytominer version + id: get_version + run: | + echo "version=$(poetry version | cut -d' ' -f2 )" + echo "version=$(poetry version | cut -d' ' -f2 )" >> $GITHUB_OUTPUT + - name: Upload artifacts + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: wheel + path: dist/*.whl + if-no-files-found: error + - name: Upload artifacts + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: sdist + path: dist/*.tar.gz + if-no-files-found: error