diff options
author | Joris Roovers <joris.roovers@gmail.com> | 2023-02-08 10:07:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-08 10:07:55 +0000 |
commit | b62766839e0ac646e31316b4740fdc7203d8d89f (patch) | |
tree | e746afb0c5429f760b452de293062416a44abc20 | |
parent | 664726de3aa820240ef95cdd316473c0d7adb3d4 (diff) |
GHA: Auto publish dev build on main (#429)
Also perform hatch download before gitlint install in test-release
workflow. This buys us a little more time for the package to show up on
PyPI before trying to install and test it.
-rw-r--r-- | .github/workflows/checks.yml | 10 | ||||
-rw-r--r-- | .github/workflows/publish-release.yml | 12 | ||||
-rw-r--r-- | .github/workflows/test-release.yml | 8 |
3 files changed, 27 insertions, 3 deletions
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d60332f..2cbbdf2 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -118,3 +118,13 @@ jobs: uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} + + # When on main, auto publish dev build + auto_publish_dev: + needs: + - check + if: github.ref == 'refs/heads/main' + uses: ./.github/workflows/publish-release.yml + with: + pypi_target: "test.pypi.org" + repo_release_ref: "main"
\ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 3700aee..aa545a9 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,6 +1,17 @@ name: Publish Release run-name: "Publish Release" on: + workflow_call: + inputs: + pypi_target: + description: "PyPI repository to publish to" + required: true + type: string + default: "test.pypi.org" + repo_release_ref: + description: "Gitlint git reference to publish release for" + type: string + default: "main" workflow_dispatch: inputs: pypi_target: @@ -12,6 +23,7 @@ on: default: "test.pypi.org" repo_release_ref: description: "Gitlint git reference to publish release for" + type: string default: "main" jobs: diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 805e344..8ebb1b0 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -48,6 +48,11 @@ jobs: with: python-version: ${{ matrix.python-version }} + # Intentionally install hatch before gitlint, to buy us a few extra seconds in case the gitlint package was just + # published and hasn't appeared on PyPI yet. + - name: Install Hatch + run: python -m pip install hatch==1.6.3 + - name: Install gitlint run: | python -m pip install gitlint==${{ inputs.gitlint_version }} @@ -67,9 +72,6 @@ jobs: with: ref: ${{ inputs.repo_test_ref }} - - name: Install Hatch - run: python -m pip install hatch==1.6.3 - - name: Integration tests (default -> GITLINT_USE_SH_LIB=1) run: | hatch run qa:integration-tests |