Skip to content

Commit

Permalink
updated jfrog upload job
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszSki committed Dec 3, 2024
1 parent 8920e65 commit 14436fe
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ jobs:
ziti_type: [tunnel, router]
goarch: [amd64, arm64]
pkg_type: [deb, rpm]
distro_name: [focal, jammy, noble]

steps:
- name: download x86 artifacts
Expand Down Expand Up @@ -306,20 +305,39 @@ jobs:
file: ./${{ env.APP_NAME }}-${{ matrix.ziti_type }}-${{ needs.build_amd64_release.outputs.version }}.x86_64.${{ matrix.pkg_type }}
release_name: ${{ needs.build_amd64_release.outputs.version }}
tag: v${{ needs.build_amd64_release.outputs.version }}

upload_jfrog:
runs-on: ubuntu-22.04
needs:
- build_amd64_release
- build_arm64_release
- deploy_packages
strategy:
matrix:
goos: [linux]
goarch: [amd64, arm64]
pkg_type: [deb]
distro_name: [focal, jammy, noble]
steps:
- name: Configure jFrog CLI
if: ${{ matrix.pkg_type == 'deb'}} && ${{ matrix.ziti_type == 'router'}}
if: ${{ matrix.pkg_type == 'deb'}}
uses: jfrog/setup-jfrog-cli@v4
env:
JF_USER: ${{ secrets.JF_USER }}
JF_PASSWORD: ${{ secrets.JF_PASSWORD }}
- name: Upload DEB to Artifactory with jFrog CLI
if: ${{ matrix.pkg_type == 'deb'}} && ${{ matrix.ziti_type == 'router'}}
if: ${{ matrix.pkg_type == 'deb'}}
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: >
run: |
asset=$(gh api /repos/netfoundry/zfw/releases --jq '( last ((.[].assets | sort_by(.created_at)).[] | select(.name=="${{ env.APP_NAME }}-router-${{ needs.build_amd64_release.outputs.version }}.${{ matrix.goarch }}.${{ matrix.pkg_type }}"))))')
curl -Ls "$(jq -r .browser_download_url <<< "$asset")" -H "Accept: application/vnd.github.v3+json" --output ./"$(jq -r .name <<< "$asset")"
ls -l ./
jf rt upload
./${{ env.APP_NAME }}-${{ matrix.ziti_type }}-${{ needs.build_amd64_release.outputs.version }}.x86_64.${{ matrix.pkg_type }}
netfoundry-deb-stable/pool/zfw-router/${{ matrix.distro_name }}/${{ matrix.goarch }}/
--deb=${{ matrix.distro_name }}/main/${{ matrix.goarch }}
--url https://netfoundry.jfrog.io/artifactory/
--recursive=false
./${{ env.APP_NAME }}-router-${{ needs.build_amd64_release.outputs.version }}.${{ matrix.goarch }}.${{ matrix.pkg_type }} /
netfoundry-deb-stable/pool/zfw-router/${{ matrix.distro_name }}/${{ matrix.goarch }} /
--deb=${{ matrix.distro_name }}/main/${{ matrix.goarch }} /
--url https://netfoundry.jfrog.io/artifactory/ /
--recursive=false /
--flat=true

0 comments on commit 14436fe

Please sign in to comment.