Closed IAmNotHanni closed 1 year ago
- name: Download artifacts
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => {
console.log(artifact.name);
console.log(artifact.name.startsWith("release_"));
return artifact.name.startsWith("release_");
});
let fs = require('fs');
for (const artifact of matchArtifacts) {
console.log(artifact);
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/`+artifact.name+`.zip`, Buffer.from(download.data));
}
This is what the filenames look like atm:
You also removed the condition if: ${{ github.event.workflow_run.conclusion == 'success' }}
How should we name the builds which are generated by the CI? Because having "release" in the name should mean that it's build with release configuration. Also, we should write "Debug" and "Release" with small letters in the file name.
What about:
operatingsystem_buildtype_compiler_x64
?
linux_debug_clang_x64
linux_release_clang_x64
linux_debug_gcc_x64
linux_release_gcc_x64
windows_debug_msvc_x64
windows_release_msvc_x64
windows_debug_msvc_x64
windows_release_msvc_x64
But how would the GitHub action be able to find them if they don't start with "release" ?
Maybe let the final builds (only the executable and config/assets/..) start with latest
?
latest_linux_debug_clang_x64 latest_linux_release_clang_x64 latest_linux_debug_gcc_x64 latest_linux_release_gcc_x64 latest_windows_debug_msvc_x64 latest_windows_release_msvc_x64 latest_windows_debug_msvc_x64 latest_windows_release_msvc_x64
Maybe let the final builds (only the executable and config/assets/..) start with
latest
?latest_linux_debug_clang_x64 latest_linux_release_clang_x64 latest_linux_debug_gcc_x64 latest_linux_release_gcc_x64 latest_windows_debug_msvc_x64 latest_windows_release_msvc_x64 latest_windows_debug_msvc_x64 latest_windows_release_msvc_x64
huh?
The uploaded stuff should already contain all required things. We should only upload the release versions. Maybe revert the naming to?
buildtype_os_arch_compiler
I don't understand: Isn't the GitHub action is picking the files which start with "release_" ?
- name: Download artifacts uses: actions/github-script@v6 with: script: | let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, run_id: context.payload.workflow_run.id, }); let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => { console.log(artifact.name); console.log(artifact.name.startsWith("release_")); return artifact.name.startsWith("release_"); }); let fs = require('fs'); for (const artifact of matchArtifacts) { console.log(artifact); let download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: artifact.id, archive_format: 'zip', }); fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/`+artifact.name+`.zip`, Buffer.from(download.data)); }
Pull request #534 did not fix the issue.
It is still broken after #535. By the way this is still wrong:
console.log(artifact.name.startsWith("release_"));
Describe The Bug
https://github.com/inexorgame/vulkan-renderer/blob/main/.github/workflows/release.yml
Since I renamed the files, the release script is broken. Sorry I didn't think about that.
Steps To Reproduce
Expected Behavior
A release is created if a pull request is merged
Affected Code
The GitHub action
Operating System
None
Application Version
3b916441c38a58d4421de8f09a5470940a90a346
Additional Context
None
Relevant Log Output