From 2164c2353bf0eebc8b3bea988b9d94631f75e7a1 Mon Sep 17 00:00:00 2001 From: Ben Sarmiento Date: Sat, 28 Oct 2023 23:19:28 +0200 Subject: [PATCH] use multi level ci pipeline --- .github/workflows/binary-build.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/binary-build.yml b/.github/workflows/binary-build.yml index 9874bb0..92ec8e0 100644 --- a/.github/workflows/binary-build.yml +++ b/.github/workflows/binary-build.yml @@ -72,6 +72,16 @@ jobs: name: zurg-${{ needs.determine_version.outputs.build_version }}-${{ matrix.goos }}-${{ matrix.goarch }}.zip path: zurg-${{ needs.determine_version.outputs.build_version }}-${{ matrix.goos }}-${{ matrix.goarch }}.zip + release: + needs: + - determine_version + - build + runs-on: ubuntu-latest + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v3 + - name: Create Release in other repo id: create_release run: | @@ -86,16 +96,15 @@ jobs: "prerelease": false }') RELEASE_ID=$(echo "$RESPONSE" | jq ".id") - echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT + echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV - name: Upload Artifacts to other repo's release run: | - ARTIFACTS=($(ls *.zip)) - for artifact in "${ARTIFACTS[@]}"; do + for artifact in $(ls -d */); do curl -s -X POST \ -H "Authorization: token ${{ secrets.PAT }}" \ -H "Accept: application/vnd.github.v3+json" \ -H "Content-Type: $(file -b --mime-type $artifact)" \ --data-binary "@$artifact" \ - "https://uploads.github.com/repos/debridmediamanager/zurg-testing/releases/${{ steps.create_release.outputs.release_id }}/assets?name=$(basename $artifact)" + "https://uploads.github.com/repos/debridmediamanager/zurg-testing/releases/${RELEASE_ID}/assets?name=$(basename $artifact)" done