summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2022-05-30 15:09:45 -0400
committerJulian Berman <Julian@GrayVines.com>2022-05-30 15:09:45 -0400
commit679e82bb555ad65f555a50276e1c5cbd9bc65eb4 (patch)
treebce15063578e07f4f0d438ce1d93ea9bab35f86d /.github
parent9b22313143a7de18a08f7852dede1aa86929a6da (diff)
downloadjsonschema-679e82bb555ad65f555a50276e1c5cbd9bc65eb4.tar.gz
Combine the CI and packaging workflows.
And only run the latter after the former.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml36
-rw-r--r--.github/workflows/packaging.yml43
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
- });