From 0e2c6b29360be2eac18f04dae4b3adc8f2e88e42 Mon Sep 17 00:00:00 2001 From: Kieron Morris Date: Sun, 9 Mar 2025 22:25:08 +0000 Subject: [PATCH] Final commit to merge through develop & master - CI/CD Pipeline now working & tested. - Commits to all branches will trigger the pipeline in DroneCI. - Commits to master will trigger the resulting ISO artefact to be uploaded to Gitea as a Package. # Conflicts: # .drone.yml --- .drone.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..f868f1a8 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,52 @@ +kind: pipeline +type: docker +name: build + +steps: + - name: build-image + image: plugins/docker + settings: + repo: t3hn3rd/asuro-build + tags: latest + dockerfile: Dockerfile + registry: docker.io + username: + from_secret: docker_username + password: + from_secret: docker_password + + - name: compile + image: t3hn3rd/asuro-build:latest + depends_on: + - build-image + commands: + - git fetch --tags + - find . -type f -print0 | xargs -0 dos2unix + - chmod +x /drone/src/*.sh + - /drone/src/compile.sh + + - name: upload-iso-artifact + image: alpine/git + depends_on: + - compile + when: + branch: + - master + environment: + GITEA_TOKEN: + from_secret: gitea_token + commands: + - apk add --no-cache curl + - chmod +w Asuro.iso + - cp Asuro.iso "Asuro-$(git rev-parse --short HEAD).iso" + - echo "Uploading Asuro-$(git rev-parse --short HEAD).iso to Gitea Packages..." + - | + curl -X PUT "https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/$(git rev-parse --short HEAD)/Asuro.iso" \ + -H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso" + - echo "Updating latest ISO reference..." + - | + curl -X DELETE https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \ + -H "Authorization: token $GITEA_TOKEN" || echo "No previous latest version found." + - | + curl -X PUT https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \ + -H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso" \ No newline at end of file