Update .drone.yml
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Sthope 2023-08-28 18:52:28 +02:00
parent ec611706b6
commit 40e051ef6e

View File

@ -2,30 +2,32 @@ kind: pipeline
name: release name: release
steps: steps:
- name: run-script - name: create-script-file
image: node:14 image: node:14-alpine
commands: commands:
- | - apk add --no-cache npm # Install npm in Alpine Linux
echo "const axios = require('axios');" > custom-script.js - echo "const axios = require('axios');" > custom-script.js
echo "" >> custom-script.js - echo "" >> custom-script.js
echo "function getLatestReleaseTag() {" >> custom-script.js - echo "function getLatestReleaseTag() {" >> custom-script.js
echo " return axios" >> custom-script.js - echo " return axios" >> custom-script.js
echo " .get('https://api.github.com/repos/insignia-live/setup-assistant-release/releases/latest')" >> custom-script.js - echo " .get('https://api.github.com/repos/insignia-live/setup-assistant-release/releases/latest')" >> custom-script.js
echo " .then((response) => response.data.tag_name)" >> custom-script.js - echo " .then((response) => response.data.tag_name)" >> custom-script.js
echo " .catch((error) => {" >> custom-script.js - echo " .catch((error) => {" >> custom-script.js
echo " console.error('Error fetching latest release tag:', error.message);" >> custom-script.js - echo " console.error('Error fetching latest release tag:', error.message);" >> custom-script.js
echo " return '0.0.0';" >> custom-script.js - echo " return '0.0.0';" >> custom-script.js
echo " });" >> custom-script.js - echo " });" >> custom-script.js
echo "}" >> custom-script.js - echo "}" >> custom-script.js
echo "" >> custom-script.js - echo "" >> custom-script.js
echo "getLatestReleaseTag().then((latestReleaseTag) => {" >> custom-script.js - echo "getLatestReleaseTag().then((latestReleaseTag) => {" >> custom-script.js
echo " const targetReleaseTag = '2023-02-13-1223';" >> custom-script.js - echo " const targetReleaseTag = '2023-02-13-1223';" >> custom-script.js
echo "" >> custom-script.js - echo "" >> custom-script.js
echo " if (latestReleaseTag > targetReleaseTag) {" >> custom-script.js - echo " if (latestReleaseTag > targetReleaseTag) {" >> custom-script.js
echo " console.log('This pipeline is run because the new release is newer than the one I have.');" >> custom-script.js - echo " console.log('This pipeline is run because the new release is newer than the one I have.');" >> custom-script.js
echo " } else if (latestReleaseTag === targetReleaseTag) {" >> custom-script.js - echo " } else if (latestReleaseTag === targetReleaseTag) {" >> custom-script.js
echo " console.log('The release tag is the same as the target tag.');" >> custom-script.js - echo " console.log('The release tag is the same as the target tag.');" >> custom-script.js
echo " } else {" >> custom-script.js - echo " } else {" >> custom-script.js
echo " console.log('The new release is older than the one I have.');" >> custom-script.js - echo " console.log('The new release is older than the one I have.');" >> custom-script.js
echo "}" >> custom-script.js - echo "}" >> custom-script.js
echo "" >> custom-script.js - echo "" >> custom-script.js
- npm install axios
- node custom-script.js