From 003859754dc2e22f1550ff32c9ebb1ca614cebcc Mon Sep 17 00:00:00 2001 From: bparmar-splunk Date: Thu, 10 Mar 2022 17:32:37 +0530 Subject: [PATCH] Github release workflow modified Update: - API docs are generated. (Zip file) - Upload artifact module of github action was used to upload docs zip. --- .github/workflows/release.yml | 16 ++++++++++++++-- .github/workflows/test.yml | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 450736ec8..d588537b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ on: push: branches: - master - workflow_dispatch: {} + workflow_dispatch: { } jobs: find_version: @@ -21,6 +21,13 @@ jobs: - name: Get version id: get-version run: python -c 'import splunklib; print("::set-output name=version::%s" % splunklib.__version__)' + - name: Install tox + run: pip install tox + - name: Generate API docs + run: | + rm -rf ./docs/_build + tox -e docs + cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX" tag_version: needs: find_version name: Tag Version @@ -32,7 +39,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ needs.find_version.outputs.version }} release: - needs: [find_version, tag_version] + needs: [ find_version, tag_version ] name: Create Release runs-on: ubuntu-latest steps: @@ -52,6 +59,11 @@ jobs: **TODO: Insert CHANGELOG.md contents here.** draft: false prerelease: false + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: apidocs + path: docs/_build/docs_html.zip publish: needs: release name: Deploy Release to PyPI diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e09f04988..42713a686 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: Python CI on: - [push, pull_request] + [ push, pull_request ] jobs: build: @@ -11,7 +11,7 @@ jobs: matrix: os: - ubuntu-latest - python: [2.7, 3.7] + python: [ 2.7, 3.7 ] splunk-version: - "8.0" - "latest"