mirror of
https://codeberg.org/librewolf/source.git
synced 2025-01-08 13:50:07 -05:00
Tue Sep 12 04:18:07 PM CEST 2023
This commit is contained in:
parent
32e0ca7bf6
commit
53d14b7445
3 changed files with 52 additions and 51 deletions
|
@ -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];
|
const version = process.argv[2];
|
||||||
if (!version) {
|
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);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +73,15 @@ async function addReleaseArtifact(fileName: string, releaseId: number) {
|
||||||
async function createNewRelease() {
|
async function createNewRelease() {
|
||||||
const releaseUrl = `${repoUrl}/releases`;
|
const releaseUrl = `${repoUrl}/releases`;
|
||||||
const requestBody = {
|
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,
|
draft: false,
|
||||||
name: `Release ${version}`,
|
name: `Release ${version}`,
|
||||||
prerelease: false,
|
prerelease: false,
|
||||||
|
@ -77,7 +92,7 @@ async function createNewRelease() {
|
||||||
const response = await axios.post(releaseUrl, requestBody, { headers: headers });
|
const response = await axios.post(releaseUrl, requestBody, { headers: headers });
|
||||||
|
|
||||||
if (response.status === 201) {
|
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);
|
await addReleaseArtifact(sha256sum_artifact, response.data.id);
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Failed to create release. Unexpected response status: ${response.status}`);
|
throw new Error(`Failed to create release. Unexpected response status: ${response.status}`);
|
||||||
|
|
|
@ -24,54 +24,40 @@ steps:
|
||||||
|
|
||||||
- make all
|
- 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
|
secrets: [aws_access_key_id, aws_secret_access_key]
|
||||||
######
|
|
||||||
#
|
|
||||||
# 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 ]
|
|
||||||
#
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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} )
|
||||||
|
|
||||||
# uploading to stortage.ci.librewolf.net
|
secrets: [ cb_api_key ]
|
||||||
####
|
|
||||||
#
|
|
||||||
# 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"
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
release
2
release
|
@ -1 +1 @@
|
||||||
1
|
2
|
||||||
|
|
Loading…
Reference in a new issue