Skip to content

Commit 30bda1b

Browse files
committed
Added Splunkbase upload to release mgmt
1 parent 8ae58b3 commit 30bda1b

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/manual-release.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,30 @@ jobs:
138138
name: Upload to Splunkbase
139139
runs-on: ubuntu-latest
140140
steps:
141-
- name: Placeholder for publish
141+
- name: Download artifact
142+
uses: actions/download-artifact@v2
143+
with:
144+
name: app_tgz
145+
146+
- name: Get artifact name
147+
id: app-name
148+
run: |
149+
app_package=$(ls -1 *gz | xargs basename)
150+
echo "::set-output name=package::${app_package}"
151+
152+
- name: Test connectivity
153+
run: |
154+
if ! ${{ secrets.SPLUNKBASE_ID != '' }} ; then exit 1; fi
155+
156+
# curl --fail -s -u ${{ secrets.SPLUNK_USER }}:${{ secrets.SPLUNK_PASS }} --request GET "https://splunkbase.splunk.com/api/v1/app/${{ secrets.SPLUNKBASE_ID }}/"
157+
158+
# Ref: https://dev.splunk.com/enterprise/docs/releaseapps/splunkbase/submitcontentui/#Submit-content-to-Splunkbase-with-the-Release-API
159+
- name: "Upload package to Splunkbase"
160+
if: ${{ success() }}
142161
run: |
143-
echo "Placeholder for Splunkbase upload"
162+
mkdir build
163+
tar -xf ${{ steps.app-name.outputs.package }} -C build
164+
PACKAGE=$(ls build/*)
165+
echo ${PACKAGE}
166+
echo ${{ steps.app-name.outputs.package }}
167+
curl --fail -s -u ${{ secrets.SPLUNK_USER }}:${{ secrets.SPLUNK_PASS }} --request POST https://splunkbase.splunk.com/api/v1/app/${{ secrets.SPLUNKBASE_ID }}/new_release/ -F "files[]=@${PACKAGE}" -F "filename=${{ steps.app-name.outputs.package }}" -F "splunk_versions=${{ secrets.SPLUNKBASE_SPLUNK_VERSION }}" -F "visibility=true"

0 commit comments

Comments
 (0)