Update .gitlab-ci.yml file

This commit is contained in:
WinterMyst 2024-09-21 23:48:59 +00:00
parent 7fc334ab80
commit 97c5360dab

View File

@ -30,13 +30,15 @@ release:
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
script:
# Check if VERSION is provided
- if [ -z "$VERSION" ]; then echo "Error: VERSION variable is required." && exit 1; fi
- |
if [ -z "$VERSION" ]; then echo "Error: VERSION variable is required." && exit 1; fi
# Run Gulp release task (includes zipping)
- gulp release
# Create a release on GitLab
- export RELEASE_RESPONSE=$(curl --request POST \
- |
export RELEASE_RESPONSE=$(curl --request POST \
--header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--header "Content-Type: application/json" \
--data '{
@ -58,7 +60,8 @@ release:
- export RELEASE_URL=$(echo $RELEASE_RESPONSE | jq -r '.assets.links[0].url')
# Update the system.json file with the release URL
- sed -i "s|\"download\":.*|\"download\": \"$RELEASE_URL\",|" system.json
- |
sed -i "s|\"download\":.*|\"download\": \"$RELEASE_URL\",|" system.json
# Commit the updated system.json and push it to master
- git config --global user.name "GitLab CI"
@ -68,7 +71,8 @@ release:
- git push origin master
# Publish the release to the Foundry API
- curl -X POST https://api.foundryvtt.com/_api/packages/release_version/ \
- |
curl -X POST https://api.foundryvtt.com/_api/packages/release_version/ \
-H "Authorization: $FOUNDRY_API_KEY" \
-H "Content-Type: application/json" \
-d '{