Skip to content

Commit 9a44dda

Browse files
authored
CI/CD fixes (#4)
* Updated pipeline for appinspect * Updated pipeline for release --------- Co-authored-by: Erica Pescio <[email protected]>
1 parent 90b2e4e commit 9a44dda

File tree

2 files changed

+78
-74
lines changed

2 files changed

+78
-74
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
app_id: ${{ steps.appinfo.outputs.app_id }}
1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818

1919
- name: Fetch and set app info
2020
id: appinfo
2121
run: |
2222
APP_ID=$(cat app.manifest | jq -r '.info.id.name')
23-
echo "::set-output name=app_id::${APP_ID}"
23+
echo "app_id=${APP_ID}" >> $GITHUB_OUTPUT
2424
APP_NAME=$(echo "$APP_ID" | tr _ - )
25-
echo "::set-output name=app_name::${APP_NAME}"
25+
echo "app_name=${APP_NAME}" >> $GITHUB_OUTPUT
2626
2727
- name: Excluding images from README
2828
run: |
@@ -34,7 +34,7 @@ jobs:
3434
tar -zcvf dist/${{ steps.appinfo.outputs.app_name }}.tgz --exclude='.[^/]*' --exclude=./dist .
3535
3636
- name: Upload artifact
37-
uses: actions/upload-artifact@v2
37+
uses: actions/upload-artifact@v3
3838
with:
3939
name: app_tgz
4040
path: dist/${{ steps.appinfo.outputs.app_name }}.tgz
@@ -45,12 +45,12 @@ jobs:
4545
runs-on: ubuntu-latest
4646
steps:
4747
- name: Download artifact
48-
uses: actions/download-artifact@v2
48+
uses: actions/download-artifact@v3
4949
with:
5050
name: app_tgz
5151

5252
- name: Set up Python
53-
uses: actions/setup-python@v2
53+
uses: actions/setup-python@v4
5454
with:
5555
python-version: 3.7
5656

@@ -73,7 +73,7 @@ jobs:
7373
runs-on: ubuntu-latest
7474
steps:
7575
- name: Download artifact
76-
uses: actions/download-artifact@v2
76+
uses: actions/download-artifact@v3
7777
with:
7878
name: app_tgz
7979

@@ -83,7 +83,7 @@ jobs:
8383
tar -xf ${{ needs.bundle-app.outputs.app_name }}.tgz -C build/${{ needs.bundle-app.outputs.app_id }}
8484
8585
- name: Setup Python
86-
uses: actions/setup-python@v2
86+
uses: actions/setup-python@v4
8787
with:
8888
python-version: 3.7
8989

@@ -97,27 +97,27 @@ jobs:
9797
exit `cat appinspect.json | jq '.summary.failure'`
9898
working-directory: ./build
9999

100-
appinspect-api:
101-
name: AppInspect API Validation
102-
needs:
103-
- bundle-app
104-
- appinspect-cli
105-
- slim-validate
106-
runs-on: ubuntu-latest
107-
# Job not executed if branch is not master
108-
if: github.ref == 'refs/heads/master'
109-
steps:
110-
- name: Download artifact
111-
uses: actions/download-artifact@v2
112-
with:
113-
name: app_tgz
100+
# appinspect-api:
101+
# name: AppInspect API Validation
102+
# needs:
103+
# - bundle-app
104+
# - appinspect-cli
105+
# - slim-validate
106+
# runs-on: ubuntu-latest
107+
# # Job not executed if branch is not master
108+
# if: github.ref == 'refs/heads/master'
109+
# steps:
110+
# - name: Download artifact
111+
# uses: actions/download-artifact@v2
112+
# with:
113+
# name: app_tgz
114114

115-
- name: Run AppInspect
116-
uses: splunk/appinspect-api-action@v2
117-
with:
118-
filePath: ${{ needs.bundle-app.outputs.app_name }}.tgz
119-
splunkUser: ${{ secrets.SPLUNK_USER }}
120-
splunkPassword: ${{ secrets.SPLUNK_PASS }}
121-
includedTags: cloud
122-
failOnError: true
123-
failOnWarning: false
115+
# - name: Run AppInspect
116+
# uses: splunk/appinspect-api-action@v2
117+
# with:
118+
# filePath: ${{ needs.bundle-app.outputs.app_name }}.tgz
119+
# splunkUser: ${{ secrets.SPLUNK_USER }}
120+
# splunkPassword: ${{ secrets.SPLUNK_PASS }}
121+
# includedTags: cloud
122+
# failOnError: true
123+
# failOnWarning: false

.github/workflows/manual-release.yml

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
description: 'Changelog notes'
1414
required: false
1515

16+
permissions:
17+
contents: write
18+
packages: write
19+
1620
jobs:
1721
tag-version:
1822
name: Tag Version
@@ -26,17 +30,17 @@ jobs:
2630
if: contains(['major', 'minor', 'patch'], ${{ github.event.inputs.bumpPart }})
2731
steps:
2832
- name: Checkout source
29-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
3034

31-
- name: Fetch and set app info
35+
- name: Get app info
3236
id: appinfo
3337
run: |
3438
APP_NAME=$(cat app.manifest | jq -r '.info.id.name' | tr _ - )
35-
echo "::set-output name=app_name::${APP_NAME}"
39+
echo "app_name=${APP_NAME}" >> $GITHUB_OUTPUT
3640
3741
- name: Bump version and push tag
3842
id: bumpversion
39-
uses: jaumann/github-bumpversion-action@v0.0.7
43+
uses: jasonamyers/github-bumpversion-action@v1.0.4
4044
env:
4145
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4246
DEFAULT_BUMP: ${{ github.event.inputs.bumpPart }}
@@ -46,19 +50,19 @@ jobs:
4650
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
4751
git push "${remote_repo}" HEAD:${GITHUB_REF} --follow-tags --tags
4852
49-
- name: Get sha
53+
- name: Get SHA
5054
id: sha
5155
run: |
5256
sha_new=$(git rev-parse HEAD)
53-
echo "::set-output name=sha::$sha_new"
57+
echo "sha=${sha_new}" >> $GITHUB_OUTPUT
5458
5559
build:
5660
name: Generate App Bundle
5761
needs: tag-version
5862
runs-on: ubuntu-latest
5963
steps:
6064
- name: Checkout code
61-
uses: actions/checkout@v2
65+
uses: actions/checkout@v3
6266
with:
6367
ref: ${{ needs.tag-version.outputs.new_sha }}
6468
fetch-depth: 0
@@ -70,12 +74,12 @@ jobs:
7074
- name: Bundle app source
7175
run: |
7276
mkdir dist
73-
tar -zcvf dist/${{ needs.tag-version.outputs.app_name }}-${{ needs.tag-version.outputs.version }}.tar.gz --exclude='.[^/]*' --exclude=./dist .
77+
tar -zcvf dist/${{ needs.tag-version.outputs.app_name }}_v${{ needs.tag-version.outputs.version }}.tgz --exclude='.[^/]*' --exclude=./dist .
7478
75-
- uses: actions/upload-artifact@v2
79+
- uses: actions/upload-artifact@v3
7680
with:
7781
name: app_tgz
78-
path: dist/${{ needs.tag-version.outputs.app_name }}-${{ needs.tag-version.outputs.version }}.tar.gz
82+
path: dist/${{ needs.tag-version.outputs.app_name }}_v${{ needs.tag-version.outputs.version }}.tgz
7983

8084
release:
8185
name: Create Release
@@ -85,7 +89,7 @@ jobs:
8589
runs-on: ubuntu-latest
8690
steps:
8791
- name: Checkout code
88-
uses: actions/checkout@v2
92+
uses: actions/checkout@v3
8993

9094
- name: Fetch all tags
9195
run: |
@@ -103,7 +107,7 @@ jobs:
103107
else
104108
content="Initial release"
105109
fi
106-
echo "::set-output name=message::${content}"
110+
echo "message=${content}" >> $GITHUB_OUTPUT
107111
108112
- name: Create Release
109113
id: create_release
@@ -122,15 +126,15 @@ jobs:
122126
prerelease: false
123127

124128
- name: Download artifact
125-
uses: actions/download-artifact@v2
129+
uses: actions/download-artifact@v3
126130
with:
127131
name: app_tgz
128132

129133
- name: Get artifact name
130134
id: app-name
131135
run: |
132136
app_package=$(ls -1 *gz | xargs basename)
133-
echo "::set-output name=package::${app_package}"
137+
echo "package=${app_package}" >> $GITHUB_OUTPUT
134138
135139
- name: Upload Release Asset
136140
id: upload-release-asset
@@ -143,35 +147,35 @@ jobs:
143147
asset_name: ${{ steps.app-name.outputs.package }}
144148
asset_content_type: application/tgz
145149

146-
publish:
147-
needs: release
148-
name: Upload to Splunkbase
149-
runs-on: ubuntu-latest
150-
steps:
151-
- name: Download artifact
152-
uses: actions/download-artifact@v2
153-
with:
154-
name: app_tgz
150+
# publish:
151+
# needs: release
152+
# name: Upload to Splunkbase
153+
# runs-on: ubuntu-latest
154+
# steps:
155+
# - name: Download artifact
156+
# uses: actions/download-artifact@v2
157+
# with:
158+
# name: app_tgz
155159

156-
- name: Get artifact name
157-
id: app-name
158-
run: |
159-
app_package=$(ls -1 *gz | xargs basename)
160-
echo "::set-output name=package::${app_package}"
160+
# - name: Get artifact name
161+
# id: app-name
162+
# run: |
163+
# app_package=$(ls -1 *gz | xargs basename)
164+
# echo "::set-output name=package::${app_package}"
161165

162-
- name: Test connectivity
163-
run: |
164-
if ! ${{ secrets.SPLUNKBASE_ID != '' }} ; then exit 1; fi
165-
curl --fail -s -u ${{ secrets.SPLUNK_USER }}:${{ secrets.SPLUNK_PASS }} --request GET "https://splunkbase.splunk.com/api/v1/app/${{ secrets.SPLUNKBASE_ID }}/"
166+
# - name: Test connectivity
167+
# run: |
168+
# if ! ${{ secrets.SPLUNKBASE_ID != '' }} ; then exit 1; fi
169+
# curl --fail -s -u ${{ secrets.SPLUNK_USER }}:${{ secrets.SPLUNK_PASS }} --request GET "https://splunkbase.splunk.com/api/v1/app/${{ secrets.SPLUNKBASE_ID }}/"
166170

167-
# Ref: https://dev.splunk.com/enterprise/docs/releaseapps/splunkbase/submitcontentui/#Submit-content-to-Splunkbase-with-the-Release-API
168-
# TODO This has to be tested on apps already public in Splunkbase
169-
- name: "Upload package to Splunkbase"
170-
if: ${{ success() }}
171-
run: |
172-
mkdir build
173-
tar -xf ${{ steps.app-name.outputs.package }} -C build
174-
PACKAGE=$(ls build/*)
175-
echo ${PACKAGE}
176-
echo ${{ steps.app-name.outputs.package }}
177-
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"
171+
# # Ref: https://dev.splunk.com/enterprise/docs/releaseapps/splunkbase/submitcontentui/#Submit-content-to-Splunkbase-with-the-Release-API
172+
# # TODO This has to be tested on apps already public in Splunkbase
173+
# - name: "Upload package to Splunkbase"
174+
# if: ${{ success() }}
175+
# run: |
176+
# mkdir build
177+
# tar -xf ${{ steps.app-name.outputs.package }} -C build
178+
# PACKAGE=$(ls build/*)
179+
# echo ${PACKAGE}
180+
# echo ${{ steps.app-name.outputs.package }}
181+
# 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)