-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
publisher: use actions/download-artifact directly (#1364)
## Summary Instead of depending on a third-party actions to download built artifacts, use GitHub's CLI to search for the wanted ID and first-party actions to download the wanted artifacts. ## Details * Replaced usage of `dawidd6/action-download-artifact` with `actions/download-artifact` . --------- Co-authored-by: zerbina <[email protected]>
- Loading branch information
Showing
1 changed file
with
35 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,47 +28,64 @@ jobs: | |
# Publish action needs a checkout | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Obtain latest successful run id | ||
id: finder | ||
run: | | ||
run_id=$(gh run list \ | ||
-c "$COMMIT" \ | ||
-w "$WORKFLOW" \ | ||
-s "$CONCLUSION" \ | ||
--limit 1 \ | ||
--json databaseId \ | ||
--jq '.[].databaseId') | ||
if [[ -z $run_id ]]; then | ||
echo "::error::Could not find any CI run for commit $COMMIT" | ||
exit 1 | ||
fi | ||
echo "run_id=$run_id" >> "$GITHUB_OUTPUT" | ||
env: | ||
COMMIT: ${{ github.event.after }} | ||
WORKFLOW: ci.yml | ||
CONCLUSION: success | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
# Download the latest instance of artifacts from a build done previously | ||
- name: Download generated docs | ||
uses: dawidd6/action-download-artifact@v6 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
workflow: ci.yml | ||
workflow_conclusion: success | ||
commit: ${{ github.event.after }} | ||
run-id: ${{ steps.finder.outputs.run_id }} | ||
# Keep up-to-date with ci.yml | ||
name: Generated docs | ||
path: doc/html | ||
github-token: ${{ github.token }} | ||
|
||
- name: Download generated source archive | ||
uses: dawidd6/action-download-artifact@v6 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
workflow: ci.yml | ||
workflow_conclusion: success | ||
commit: ${{ github.event.after }} | ||
run-id: ${{ steps.finder.outputs.run_id }} | ||
# Keep up-to-date with ci.yml | ||
name: source archive | ||
path: release-staging | ||
github-token: ${{ github.token }} | ||
|
||
- name: Download generated release binaries | ||
uses: dawidd6/action-download-artifact@v6 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
workflow: ci.yml | ||
workflow_conclusion: success | ||
commit: ${{ github.event.after }} | ||
run-id: ${{ steps.finder.outputs.run_id }} | ||
# Keep up-to-date with ci.yml | ||
name: release binaries.* | ||
name_is_regexp: true | ||
pattern: release binaries * | ||
merge-multiple: "true" | ||
path: release-staging | ||
github-token: ${{ github.token }} | ||
|
||
- name: Download release manifest tool | ||
uses: dawidd6/action-download-artifact@v6 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
workflow: ci.yml | ||
workflow_conclusion: success | ||
commit: ${{ github.event.after }} | ||
run-id: ${{ steps.finder.outputs.run_id }} | ||
# Keep up-to-date with ci.yml | ||
name: release manifest tool | ||
path: release-staging | ||
github-token: ${{ github.token }} | ||
|
||
- name: Publish docs | ||
uses: JamesIves/[email protected] | ||
|
@@ -79,11 +96,6 @@ jobs: | |
- id: release-files | ||
name: Create release manifest | ||
run: | | ||
# Move the release binaries to the current folder | ||
for d in "release binaries "*; do | ||
mv -v "$d"/* . | ||
done | ||
# Github Artifacts strip executable permissions so it has to be set again | ||
chmod 755 release_manifest | ||
# Create a new release manifest | ||
|