0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 05:33:03 -05:00

Tue Sep 12 04:18:07 PM CEST 2023

This commit is contained in:
Bert van der Weerd 2023-09-12 16:18:07 +02:00
parent 32e0ca7bf6
commit 53d14b7445
No known key found for this signature in database
GPG key ID: 73370A0B9E5516B0
3 changed files with 52 additions and 51 deletions

View file

@ -13,10 +13,17 @@ const repoUrl = 'https://codeberg.org/api/v1/repos/threadpanic/cb-src-woodpecker
// Extract the command-line argument and assign to 'version'
// Extract the first command-line argument and assign to 'version'
const version = process.argv[2];
if (!version) {
console.error('Please provide the version as a command-line argument.');
console.error('Please provide the version as the first command-line argument.');
process.exit(1);
}
// Extract the second command-line argument and assign to 'ci_build_number'
const ci_build_number = process.argv[3];
if (!ci_build_number) {
console.error('Please provide the ci_build_number as the second command-line argument.');
process.exit(1);
}
@ -66,7 +73,15 @@ async function addReleaseArtifact(fileName: string, releaseId: number) {
async function createNewRelease() {
const releaseUrl = `${repoUrl}/releases`;
const requestBody = {
body: `Release v${version} of the LibreWolf source tarball. Please see the README.md file for compilation instructions and dependency details.`,
body: `Release v${version} of the LibreWolf source tarball.
Please see the README.md file for compilation instructions and dependency details.
* [${tarball_artifact}](https://storage.ci.librewolf.net/artifacts/${ci_build_number}/librewolf-${version}.source.tar.gz)
* [${sha256sum_artifact}](https://storage.ci.librewolf.net/artifacts/${ci_build_number}/librewolf-${version}.source.tar.gz.sha256sum)
Note that these artifacts don't have a long shelf life in this particular s3 server, but it demonstrates the use of exernal storage to store big artifacts.
`,
draft: false,
name: `Release ${version}`,
prerelease: false,
@ -77,7 +92,7 @@ async function createNewRelease() {
const response = await axios.post(releaseUrl, requestBody, { headers: headers });
if (response.status === 201) {
await addReleaseArtifact(tarball_artifact, response.data.id);
// await addReleaseArtifact(tarball_artifact, response.data.id);
await addReleaseArtifact(sha256sum_artifact, response.data.id);
} else {
throw new Error(`Failed to create release. Unexpected response status: ${response.status}`);

View file

@ -24,54 +24,40 @@ steps:
- make all
# uploading to storage.ci.librewolf.net
upload:
image: woodpeckerci/plugin-s3
when:
- branch: main
settings:
bucket: artifacts
source: "*.{tar.gz,sha256sum}"
target: /${CI_BUILD_NUMBER}
path_style: true
endpoint: https://storage.ci.librewolf.net
# my ts+axios api stuff
######
#
# release:
# image: alpine
# when:
# - branch: main
# commands:
# - apk update -U
# - apk add nodejs npm
#
# - ( cd .woodpecker.release && npm install && npm run build )
# - ( cd .woodpecker.release && npm run start $(cat ../version)-$(cat ../release) )
#
# secrets: [ cb_api_key ]
#
secrets: [aws_access_key_id, aws_secret_access_key]
display-links:
image: alpine
when:
- branch: main
commands:
- echo "https://storage.ci.librewolf.net/artifacts/${CI_BUILD_NUMBER}/librewolf-$(cat version)-$(cat release).source.tar.gz"
- echo "https://storage.ci.librewolf.net/artifacts/${CI_BUILD_NUMBER}/librewolf-$(cat version)-$(cat release).source.tar.gz.sha256sum"
# my ts+axios api stuff to make the codeberg release
# uploading to stortage.ci.librewolf.net
####
#
# upload:
# image: woodpeckerci/plugin-s3
# when:
# - branch: main
# settings:
# bucket: artifacts
# source: "*.{tar.gz,sha256sum}"
# target: /${CI_BUILD_NUMBER}
# path_style: true
# endpoint: https://storage.ci.librewolf.net
#
# secrets: [aws_access_key_id, aws_secret_access_key]
#
# display-links:
# image: alpine
# when:
# - branch: main
# commands:
# - echo "https://storage.ci.librewolf.net/artifacts/${CI_BUILD_NUMBER}/librewolf-$(cat version)-$(cat release).source.tar.gz"
# - echo "https://storage.ci.librewolf.net/artifacts/${CI_BUILD_NUMBER}/librewolf-$(cat version)-$(cat release).source.tar.gz.sha256sum"
#
#
#
release:
image: alpine
when:
- branch: main
commands:
- apk update -U
- apk add nodejs npm
- ( cd .woodpecker.release && npm install && npm run build )
- ( cd .woodpecker.release && npm run start $(cat ../version)-$(cat ../release) ${CI_BUILD_NUMBER} )
secrets: [ cb_api_key ]

View file

@ -1 +1 @@
1
2