Skip to content

Commit 4e907cc

Browse files
committed
tidy
1 parent 9e0414c commit 4e907cc

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

.github/workflows/upload-release-assets.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
name: Release Agent
1+
name: Publish Release packages
22

33
on:
44
workflow_dispatch:
55
inputs:
6-
version:
6+
pkgRepo:
7+
description: "Source repository to pull packages from"
8+
type: string
9+
default: ""
10+
pkgVersion:
711
description: 'Agent version'
812
type: string
913
default: ""
1014
uploadAzure:
1115
description: 'Publish packages Azure storage'
1216
type: boolean
1317
default: false
14-
githubRelease:
15-
description: 'Setup release in github'
18+
uploadGithub:
19+
description: 'Publish packages to GitHub release'
1620
type: boolean
1721
default: false
18-
pkgRepo:
19-
description: "Source repository to pull packages from"
20-
type: string
21-
default: ""
2222

2323
defaults:
2424
run:
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set variables
4444
id: vars
4545
run: |
46-
echo "github_release=${{ inputs.githubRelease }}" >> $GITHUB_OUTPUT
46+
echo "github_release=${{ inputs.uploadGithub }}" >> $GITHUB_OUTPUT
4747
echo "upload_azure=${{ inputs.uploadAzure }}" >> $GITHUB_OUTPUT
4848
cat $GITHUB_OUTPUT
4949
@@ -65,30 +65,19 @@ jobs:
6565
with:
6666
creds: ${{ secrets.AZURE_CREDENTIALS }}
6767

68-
- name: Get Id Token
69-
if: ${{ inputs.publishPackages == true }}
70-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
71-
id: idtoken
72-
with:
73-
script: |
74-
let id_token = await core.getIDToken()
75-
core.setOutput('id_token', id_token)
76-
7768
- name: Download Packages
78-
env:
79-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8069
run:
8170
|
8271
echo "Checking Packages in ${{inputs.pkgRepo}}/nginx-agent"
83-
PKG_REPO=${{inputs.pkgRepo}} CERT=${{PUBTEST_CERT}} KEY=${{PUBTEST_KEY}} DL=1 scripts/packages/package_check.sh ${{version}}
84-
find ${{inputs.pkgRepo}}/nginx-agent | grep -e "nginx-agent[_-]${{version}}"
72+
PKG_REPO=${{inputs.pkgRepo}} CERT=${{secrets.PUBTEST_CERT}} KEY=${{secrets.PUBTEST_KEY}} DL=1 scripts/packages/package_check.sh ${{inputs.pkgVersion}}
73+
find ${{inputs.pkgRepo}}/nginx-agent | grep -e "nginx-agent[_-]${{inputs.pkgVersion}}"
8574

8675
- name: Azure Upload Release Packages
8776
if: ${{ inputs.uploadAzure == true }}
8877
uses: azure/CLI@965c8d7571d2231a54e321ddd07f7b10317f34d9 # v2.0.0
8978
with:
9079
inlineScript: |
91-
for i in $(find pkgs-test.nginx.com/nginx-agent | grep -e "nginx-agent[_-]${{version}}"); do
80+
for i in $(find ${{inputs.pkgRepo}}/nginx-agent | grep -e "nginx-agent[_-]${{inputs.pkgVersion}}"); do
9281
echo "Uploading ${i} to nginx-agent/${GITHUB_REF##*/}/${i##*/}"
9382
az storage blob upload --auth-mode=login -f "$i" -c ${{ secrets.AZURE_CONTAINER_NAME }} \
9483
--account-name ${{ secrets.AZURE_ACCOUNT_NAME }} --overwrite -n nginx-agent/${GITHUB_REF##*/}/${i##*/}
@@ -100,5 +89,5 @@ jobs:
10089
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10190
# clobber overwrites existing assets of the same name
10291
run: |
103-
gh release upload --clobber v${{ inputs.packageVersion }} \
104-
$(find ${{inputs.pkgRepo}}/nginx-agent | grep -e "nginx-agent[_-]${{version}}")
92+
gh release upload --clobber v${{ inputs.pkgVersion }} \
93+
$(find ${{inputs.pkgRepo}}/nginx-agent | grep -e "nginx-agent[_-]${{inputs.pkgVersion}}")

0 commit comments

Comments
 (0)