Update the forgejo release script to upload directly to Forgejo instead of
This commit is contained in:
parent
075562c656
commit
fc0a289866
1 changed files with 4 additions and 5 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { createReadStream } from "fs";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
@ -7,15 +8,13 @@ const {
|
||||||
FORGEJO_REPOSITORY: REPO,
|
FORGEJO_REPOSITORY: REPO,
|
||||||
FORGEJO_TOKEN: TOKEN,
|
FORGEJO_TOKEN: TOKEN,
|
||||||
FORGEJO_REF_NAME: TARGET_REF,
|
FORGEJO_REF_NAME: TARGET_REF,
|
||||||
CDN_URL,
|
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
// TODO: make this upload the file to Forgejo
|
async function addReleaseAsset(releaseID, name, filepath) {
|
||||||
async function addReleaseAsset(releaseID, name) {
|
const stream = createReadStream(filepath);
|
||||||
return;
|
|
||||||
return axios.post(
|
return axios.post(
|
||||||
`${API}/repos/${REPO}/releases/${releaseID}/assets`,
|
`${API}/repos/${REPO}/releases/${releaseID}/assets`,
|
||||||
{ external_url: `${CDN_URL}/${REPO}/${TAG}/${name}`, },
|
{ attachment: stream, },
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `token ${TOKEN}`,
|
Authorization: `token ${TOKEN}`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue