Skip to content

Commit

Permalink
Merge pull request #446 from splunk/release-workflow-refactor
Browse files Browse the repository at this point in the history
Release workflow refactor
  • Loading branch information
ashah-splunk committed Apr 13, 2022
2 parents 44415b4 + af2898b commit e162cc0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 65 deletions.
77 changes: 14 additions & 63 deletions .github/workflows/release.yml
@@ -1,71 +1,10 @@
name: Release
on:
push:
branches:
- master
workflow_dispatch: { }

jobs:
find_version:
name: Find Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout source
uses: actions/checkout@v2.3.2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- 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
runs-on: ubuntu-latest
steps:
- name: Create tag
uses: tvdias/github-tagger@v0.0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.find_version.outputs.version }}
release:
needs: [ find_version, tag_version ]
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2.3.2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.find_version.outputs.version }}
release_name: Release/${{ needs.find_version.outputs.version }}
body: |
## Version ${{ needs.find_version.outputs.version }}
types: [published]

**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
jobs:
publish:
needs: release
name: Deploy Release to PyPI
runs-on: ubuntu-latest
steps:
Expand All @@ -84,6 +23,18 @@ jobs:
with:
user: __token__
password: ${{ secrets.pypi_password }}
- 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"
- name : Docs Upload
uses: actions/upload-artifact@v3
with:
name: apidocs
path: docs/_build/docs_html.zip
# Test upload
# - name: Publish package to TestPyPI
# uses: pypa/gh-action-pypi-publish@master
Expand Down
3 changes: 1 addition & 2 deletions splunklib/binding.py
Expand Up @@ -295,8 +295,7 @@ def wrapper(self, *args, **kwargs):
with _handle_auth_error("Autologin failed."):
self.login()
with _handle_auth_error(
"Autologin succeeded, but there was an auth error on "
"next request. Something is very wrong."):
"Authentication Failed! If session token is used, it seems to have been expired."):
return request_fun(self, *args, **kwargs)
elif he.status == 401 and not self.autologin:
raise AuthenticationError(
Expand Down

0 comments on commit e162cc0

Please sign in to comment.