diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5807cec32022fbb74352c63b93ffd55e7cb48eca..f23e4624ac4f6ead1186ac88405b151432fe8b81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,8 +63,7 @@ release: - nix develop .#gitlab --command release when: on_success rules: - - if: $DEPLOY_VERSION == null - - if: $CI_COMMIT_BRANCH == "master" + - if: $DEPLOY_VERSION == null && $CI_COMMIT_BRANCH == "master" deploy: stage: deploy diff --git a/CHANGELOG.md b/CHANGELOG.md index 446ae6b6a2574365f695f1389f93a1d26a96f59d..e1f927137509fd05996d17403d8fef527fdb31f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,11 @@ # Changelog - - ## [3.68.0] - 2024-06-23 ### Add Features - add on/off action to toggle switch [#207](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/207) -### Bug Fixes -- gitlab pipeline ### Changes - repair toggle test diff --git a/nix/scripts/deploy.nix b/nix/scripts/deploy.nix index 506e9d0aaa1e78359b09af18e86ebfda5082f1e2..48db12419dad021abd479638e8d6a344c7a1fedf 100644 --- a/nix/scripts/deploy.nix +++ b/nix/scripts/deploy.nix @@ -17,7 +17,7 @@ in archive=$(ls ${monster} | grep tgz) echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc - if ! publishingResult=$(${pkgs'.nodejs_20}/bin/npm publish "${monster}/$archive" --no-git-checks --access public) + if ! publishingResult=$(${pkgs'.nodejs_20}/bin/npm publish "${monster}/$archive" --json --no-git-checks --access public) then if [ -f .npmrc ] ; then rm .npmrc ; fi echo_fail "Failed to publish the project." @@ -33,6 +33,13 @@ in echo_hint "Version $(echo $publishingResult | jq .version)" echo_hint "SHA Sum: $(echo $publishingResult | jq .shasum)" echo_hint "Files: $(echo $publishingResult | jq .entryCount)" +set -x + if [ "$(echo $publishingResult | jq .id)" == null ] ; then + echo_fail "Failed to publish the project." + ${pkgs'.curl}/bin/curl --header "Content-Type: application/json" --request POST \ + --data '{"text":"Failed to publish: '$(echo $publishingResult | jq .name)' '$(echo $publishingResult | jq .version)'"}' $MATTERMOST_WEBHOOK + exit 1 + fi ${pkgs'.curl}/bin/curl --header "Content-Type: application/json" --request POST \ --data '{"text":"Deployed: '$(echo $publishingResult | jq .name)' '$(echo $publishingResult | jq .version)'"}' $MATTERMOST_WEBHOOK