Skip to content

Commit fbbd3f0

Browse files
committed
use the official download method.
1 parent bbb6358 commit fbbd3f0

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

.github/workflows/analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- 'main'
77
- 'analysis/**'
8+
- 'test-docs'
89

910
jobs:
1011
algorithms:

.github/workflows/sphinx.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,34 @@ jobs:
4040
pip install -r requirements.txt
4141
4242
# Action to download artifacts from a different workflow (analysis.yml)
43-
- name: Download figures artifact
44-
uses: dawidd6/action-download-artifact@v3
43+
- name: 'Download artifact'
44+
uses: actions/github-script@v6
4545
with:
46-
workflow: analysis.yml
47-
name: Figures
48-
branch: main
46+
script: |
47+
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
run_id: context.payload.workflow_run.id,
51+
});
52+
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
53+
return artifact.name == "Figures"
54+
})[0];
55+
let download = await github.rest.actions.downloadArtifact({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
artifact_id: matchArtifact.id,
59+
archive_format: 'zip',
60+
});
61+
let fs = require('fs');
62+
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/Figures.zip`, Buffer.from(download.data));
63+
64+
- name: 'Unzip artifact'
65+
run: unzip Figures.zip
4966

5067
- name: Build html
5168
run: |
5269
mkdir docs/_static
70+
ls
5371
mv *.pdf docs/_static/
5472
sphinx-apidoc -o docs src
5573
cd docs/

0 commit comments

Comments
 (0)