File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -113,17 +113,24 @@ jobs:
113113 name : ${{ steps.copy-files-to-dist.outputs.id }} # Correct reference here
114114 path : dist/${{ steps.copy-files-to-dist.outputs.id }}.zip
115115
116- finalize :
117- needs : process-plugin
116+ download :
118117 runs-on : ubuntu-latest
119- if : ${{ always() }}
118+ needs : build # Ensure this job runs after the "build" job
120119 steps :
121- - name : List built plugins
122- run : ls -R
123-
124- - name : Run Semantic Release
120+ - name : Download assets from the previous job
125121 run : |
126- pnpm install --save-dev semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github
127- npx semantic-release
128- env :
129- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122+ # Fetch the run ID of the previous job using the GitHub API
123+ RUN_ID=$(curl -H "Authorization: Bearer $GITHUB_TOKEN" \
124+ "https://api.github.com/repos/${{ github.repository }}/actions/runs" \
125+ | jq -r '.workflow_runs[0].id')
126+
127+ # List the assets from the previous workflow run
128+ ASSETS=$(curl -H "Authorization: Bearer $GITHUB_TOKEN" \
129+ "https://api.github.com/repos/${{ github.repository }}/actions/runs/$RUN_ID/assets" \
130+ | jq -r '.[].url')
131+
132+ # Download each asset using curl
133+ for ASSET_URL in $ASSETS; do
134+ curl -L -H "Authorization: Bearer $GITHUB_TOKEN" \
135+ -o "asset.zip" "$ASSET_URL"
136+ done
You can’t perform that action at this time.
0 commit comments