1313 description : ' Changelog notes'
1414 required : false
1515
16+ permissions :
17+ contents : write
18+ packages : write
19+
1620jobs :
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
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