Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/reusable-publish-to-splunkbase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: publish-to-splunkbase
on:
workflow_call:
inputs:
addon_version:
description: 'The version of the add-on to publish to Splunkbase'
required: true
type: string
splunk_versions:
description: 'Comma-separated list of supported Splunk versions'
required: true
type: string
cim_versions:
description: 'Comma-separated list of supported CIM versions'
required: true
type: string
secrets:
SPL_COM_USERNAME:
description: 'Splunk Community username'
required: true
SPL_COM_PASSWORD:
description: 'Splunk Community password'
required: true

jobs:
inputs-validator:
runs-on: ubuntu-latest
steps:
- id: matrix
uses: splunk/[email protected]
with:
features: PYTHON39
publish:
runs-on: ubuntu-latest
needs:
- inputs-validator
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install splunk_add_on_ucc_framework-5.69.1-py3-none-any.whl
- name: Fetch build
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download v${{ inputs.addon_version }} --pattern "*${{ inputs.addon_version }}.spl" --output release.spl
- run: |
APP_ID=$(cat .splunkbase)
export APP_ID
ucc-gen publish \
--stage \
--app-id "$APP_ID" \
--package-path release.spl \
--splunk-versions ${{ inputs.splunk_versions }} \
--cim-versions ${{ inputs.cim_versions }} \
--username ${{ secrets.SPL_COM_USERNAME }} \
--password ${{ secrets.SPL_COM_PASSWORD }}
61 changes: 61 additions & 0 deletions .github/workflows/reusable-validate-deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: validate-deploy-docs

on:
workflow_call:

jobs:
validate-docs-change:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.validate.outputs.status }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install mkdocs and plugins
run: pip install mkdocs==1.6.0 mkdocs-material==9.5.32 mkdocs-print-site-plugin==2.6.0
- name: Validate docs change
id: validate
shell: bash
run: |
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
if mkdocs build --strict; then
echo "status=success" >> "$GITHUB_OUTPUT"
echo -e "${GREEN}Docs validation success${NC}"
else
echo "status=failure" >> "$GITHUB_OUTPUT"
echo -e "${RED}Docs validation failure${NC}"
exit 1
fi

deploy-docs:
needs:
- validate-docs-change
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install mkdocs and plugins
run: pip install mkdocs==1.6.0 mkdocs-material==9.5.32 mkdocs-print-site-plugin==2.6.0
- name: Build and Deploy docs
id: deploy
shell: bash
run: |
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
if [ "${{ needs.validate-docs-change.outputs.status }}" == "failure" ]; then
echo -e "${RED}Docs validation failed, abort docs deployment... (for more details look at Validate docs change job)${NC}"
exit 1
fi
mkdocs gh-deploy --force
echo -e "${GREEN}Deployed docs on github!${NC}"
Loading