11on :
22 workflow_call :
33 inputs :
4+ asset_name :
5+ required : true
6+ type : string
7+ full_asset_name :
8+ required : true
9+ type : string
410 new_tag :
5- default : false
11+ required : true
612 type : string
713 tag :
814 required : true
@@ -13,19 +19,16 @@ permissions:
1319 id-token : write
1420
1521jobs :
16- deploy :
22+ deploy-github :
1723 runs-on : [self-hosted, v1]
1824 permissions :
19- id-token : write
2025 contents : write
2126
2227 steps :
2328 - name : Get assets
2429 run : |
2530 curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -L -o github-api.sh \
2631 https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ci/github-api.sh
27- curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -L -o cloudsmith-api.sh \
28- https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ci/cloudsmith-api.sh
2932
3033 - name : Ensure clean dist
3134 run : |
3639 name : dist
3740 path : dist
3841
39- - name : Get others vars
40- run : |
41- asset_name=adi-doctools.tar.gz
42- echo "asset_name=$asset_name" >> "$GITHUB_ENV"
43-
44- full_asset_name=$(find dist/ -maxdepth 1 -name "adi_doctools-*.tar.gz" -print -quit)
45- echo "full_asset_name=$full_asset_name" >> "$GITHUB_ENV"
46-
4742 - name : Get pre-release vars
4843 run : |
4944 source ./github-api.sh
9893 gh-upload-asset ${{ secrets.GITHUB_TOKEN }} \
9994 ${{ github.repository }} \
10095 $release_id \
101- $asset_name \
102- $full_asset_name
96+ ${{ inputs. asset_name }} \
97+ ${{ inputs. full_asset_name }}
10398
10499 - name : GitHub update pre-release target commitish
105100 run : |
@@ -121,8 +116,8 @@ jobs:
121116 gh-upload-asset ${{ secrets.GITHUB_TOKEN }} \
122117 ${{ github.repository }} \
123118 $pre_release_id \
124- $asset_name \
125- $full_asset_name
119+ ${{ inputs. asset_name }} \
120+ ${{ inputs. full_asset_name }}
126121
127122 - name : GitHub update latest target commitish
128123 if : ${{ inputs.new_tag == 'true' }}
@@ -146,8 +141,29 @@ jobs:
146141 gh-upload-asset ${{ secrets.GITHUB_TOKEN }} \
147142 ${{ github.repository }} \
148143 $latest_id \
149- $asset_name \
150- $full_asset_name
144+ ${{ inputs.asset_name }} \
145+ ${{ inputs.full_asset_name }}
146+
147+ deploy-cloudsmith :
148+ runs-on : [self-hosted, v1]
149+ permissions :
150+ id-token : write
151+ contents : write
152+
153+ steps :
154+ - name : Get assets
155+ run : |
156+ curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -L -o cloudsmith-api.sh \
157+ https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/ci/cloudsmith-api.sh
158+
159+ - name : Ensure clean dist
160+ run : |
161+ rm -rf dist
162+
163+ - uses : actions/download-artifact@v4
164+ with :
165+ name : dist
166+ path : dist
151167
152168 -
uses :
cloudsmith-io/[email protected] 153169 env :
@@ -158,6 +174,12 @@ jobs:
158174 oidc-service-slug : ${{ secrets.CLOUDSMITH_SERVICE_SLUG }}
159175 oidc-auth-only : ' true'
160176
177+ - name : Cloudsmith API Key
178+ env :
179+ CLOUDSMITH_SERVICE_SLUG : ${{ secrets.CLOUDSMITH_SERVICE_SLUG }}
180+ if : ${{ env.CLOUDSMITH_SERVICE_SLUG == '' }}
181+ run : echo "CLOUDSMITH_API_KEY=${{ secrets.CLOUDSMITH_API_KEY }}" >> "$GITHUB_ENV"
182+
161183 - name : Cloudsmith upload asset and create package
162184 if : ${{ env.CLOUDSMITH_API_KEY != '' }}
163185 run : |
@@ -174,11 +196,11 @@ jobs:
174196 tags_+=", on/${{ github.event_name }}"
175197
176198 package_file=$(
177- cs-upload- package ${{ env.CLOUDSMITH_API_KEY }} \
199+ cs-package-upload ${{ env.CLOUDSMITH_API_KEY }} \
178200 ${{ vars.CLOUDSMITH_NAMESPACE }} \
179201 ${{ vars.CLOUDSMITH_REPOSITORY }} \
180- $asset_name \
181- $full_asset_name \
202+ ${{ inputs. asset_name }} \
203+ ${{ inputs. full_asset_name }}
182204 latest_package_file
183205 )
184206
@@ -188,6 +210,12 @@ jobs:
188210 $package_file \
189211 $tags_
190212
213+ deploy-gh-pages :
214+ runs-on : [self-hosted, v1]
215+ permissions :
216+ contents : write
217+
218+ steps :
191219 - uses : analogdevicesinc/doctools/blank@action
192220
193221 - name : Prepare gh-pages branch
0 commit comments