diff options
author | Julian Berman <Julian@GrayVines.com> | 2022-05-30 15:09:45 -0400 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2022-05-30 15:09:45 -0400 |
commit | 679e82bb555ad65f555a50276e1c5cbd9bc65eb4 (patch) | |
tree | bce15063578e07f4f0d438ce1d93ea9bab35f86d | |
parent | 9b22313143a7de18a08f7852dede1aa86929a6da (diff) | |
download | jsonschema-679e82bb555ad65f555a50276e1c5cbd9bc65eb4.tar.gz |
Combine the CI and packaging workflows.
And only run the latter after the former.
-rw-r--r-- | .github/workflows/ci.yml | 36 | ||||
-rw-r--r-- | .github/workflows/packaging.yml | 43 |
2 files changed, 36 insertions, 43 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9ef1ae..ad885a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,3 +196,39 @@ jobs: run: python -m pip install tox - name: Run tox run: python -m tox -e "${{ matrix.python-version.toxenv }}" + + packaging: + needs: ci + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: python -m pip install build + - name: Create packages + run: python -m build . + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + - name: Publish package + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + - name: Create Release Notes + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + await github.request(`POST /repos/${{ github.repository }}/releases`, { + tag_name: "${{ github.ref }}", + generate_release_notes: true + }); diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml deleted file mode 100644 index 0b4df27..0000000 --- a/.github/workflows/packaging.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Packaging - -on: - push: - release: - types: [published] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies - run: python -m pip install build - - name: Create packages - run: python -m build . - - uses: actions/upload-artifact@v2 - with: - name: dist - path: dist - - name: Publish package - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} - - name: Create Release Notes - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - await github.request(`POST /repos/${{ github.repository }}/releases`, { - tag_name: "${{ github.ref }}", - generate_release_notes: true - }); |