Ensure the uploadScript gets the environment variables it requires and clean up asset adding error
This commit is contained in:
parent
7245e89c62
commit
9e3bc775b4
2 changed files with 15 additions and 15 deletions
14
.forgejo/workflows/publish-release.yaml
Normal file
14
.forgejo/workflows/publish-release.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
on:
|
||||
release:
|
||||
types: [published]
|
||||
jobs:
|
||||
undraft-on-github:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: copy release description to github
|
||||
- name: publish github release
|
||||
release-to-foundry:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: retrieve release URLS
|
||||
- name: publish to Foundry
|
||||
|
|
@ -42,21 +42,7 @@ async function main() {
|
|||
await addReleaseAsset(release.data.id, `release.zip`);
|
||||
await addReleaseAsset(release.data.id, `system.json`);
|
||||
} catch (e) {
|
||||
console.error(`Failed to upload files, deleting draft release`);
|
||||
console.error(e);
|
||||
|
||||
try {
|
||||
await axios.delete(
|
||||
`${API}/repos/${REPO}/releases/${release.data.id}`,
|
||||
{
|
||||
headers: { Authorization: `token ${TOKEN}` },
|
||||
}
|
||||
)
|
||||
} catch {
|
||||
console.error(`Failed to delete draft release`);
|
||||
};
|
||||
|
||||
process.exit(1);
|
||||
console.error(`Failed to add assets to the release`);
|
||||
};
|
||||
|
||||
console.log(`Release created, and files uploaded successfully!`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue