use action

This commit is contained in:
Ben Sarmiento
2023-10-29 09:39:32 +01:00
parent 586d33532d
commit e42deb0e53

View File

@@ -78,38 +78,14 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Create Release in other repo
id: create_release
run: |
RESPONSE=$(curl -s -X POST \
-H "Authorization: token ${{ secrets.PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/debridmediamanager/zurg-testing/releases \
-d '{
"tag_name": "${{ needs.determine_version.outputs.build_version }}",
"name": "${{ needs.determine_version.outputs.build_version }}",
"draft": false,
"prerelease": false
}')
RELEASE_ID=$(echo "$RESPONSE" | jq ".id")
# Set the RELEASE_ID environment variable for subsequent steps
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
- name: List files
run: ls -lash *.zip
- name: Upload Artifacts to other repo's release
run: |
for artifact in *.zip; do
echo ${{ steps.create_release.outputs.release_id }}
echo $(basename "$artifact")
echo "@$artifact"
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")"
done
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.determine_version.outputs.build_version }}
tag_name: ${{ needs.determine_version.outputs.build_version }}
generate_release_notes: false
files: |
*.zip
token: ${{ secrets.PAT }}
env:
GITHUB_REPOSITORY: debridmediamanager/zurg-testing