Update .gitlab-ci.yml file

This commit is contained in:
WinterMyst 2024-09-23 15:44:12 +00:00
parent 1619c9fb01
commit e1097fffc1

View File

@ -24,7 +24,7 @@ compile:
# Release Job (manually triggered with version) # Release Job (manually triggered with version)
release: release:
stage: release stage: release
image: ubuntu:latest # Or any other basic image image: registry.gitlab.com/gitlab-org/release-cli:latest
before_script: before_script:
# Install Node.js v21.7.3 manually # Install Node.js v21.7.3 manually
- apt-get update && apt-get install -y curl jq git openssh-client - apt-get update && apt-get install -y curl jq git openssh-client
@ -52,26 +52,25 @@ release:
- gulp release - gulp release
# Create a release on GitLab # Create a release on GitLab
- | - >
export RELEASE_RESPONSE=$(curl --request POST \ curl --request POST \
--header "PRIVATE-TOKEN: ${GITLAB_PAT}" \ --header "PRIVATE-TOKEN: ${GITLAB_PAT}" \
--header "Content-Type: application/json" \ --header "Content-Type: application/json" \
--data '{ --data "{
"name": "Release v'$VERSION'", \"name\": \"Release v$VERSION\",
"tag_name": "v'$VERSION'", \"tag_name\": \"v$VERSION\",
"description": "Release v'$VERSION'", \"description\": \"Release v$VERSION\",
"ref": "master", \"ref\": \"master\",
"assets": { \"assets\": {
"links": [ \"links\": [
{ {
"name": "Download kidsonbrooms.zip", \"name\": \"Download kidsonbrooms.zip\",
"url": "https://gitlab.com/wintermyst/kidsonbrooms/-/jobs/$CI_JOB_ID/artifacts/download" \"url\": \"https://gitlab.com/wintermyst/kidsonbrooms/-/jobs/$CI_JOB_ID/artifacts/download\"
} }
] ]
} }
}' "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/releases") }" "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/releases"
# Update system.json
# Get the release URL from the response
- export RELEASE_URL=$(echo $RELEASE_RESPONSE | jq -r '.assets.links[0].url') - export RELEASE_URL=$(echo $RELEASE_RESPONSE | jq -r '.assets.links[0].url')
# Update the system.json file with the release URL # Update the system.json file with the release URL