Skip to content

try to use the upload artifact action for uploading release asset #2

try to use the upload artifact action for uploading release asset

try to use the upload artifact action for uploading release asset #2

#on:
# release:
# types: [created, edited]
on: ["push", "workflow_dispatch"]
name: Upload Release Asset
jobs:
run:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Prepare release artifact
run: .github/workflows/scripts/prepare-release.sh
- name: Get Latest Release ID
id: get-release-id
run: |
response=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases/latest")
release_id=$(echo "$response" | jq -r '.id')
echo "::set-output name=release_id::$release_id"
- name: Get Latest Release Upload URL
id: get-release-upload-url
run: |
response=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases/latest")
upload_url=$(echo "$response" | jq -r '.upload_url' | sed 's/{?name,label}//g')
echo "::set-output name=upload_url::$upload_url"
- name: Use Latest Release Info
run: |
echo "Latest Release ID: ${{ steps.get-release-id.outputs.release_id }}"
echo "Latest Release Upload URL: ${{ steps.get-release-upload-url.outputs.upload_url }}"
- name: Marketplace Release Artifacts
id: marketplace-release-Artifact
uses: actions/upload-artifact@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get-release-upload-url.outputs.upload_url }}
asset_path: ./AdyenPaymentShopware6.zip
asset_name: AdyenPaymentShopware6.zip
asset_content_type: application/zip