From 89f65e602594cfcac7f353b9292e21cd0a636312 Mon Sep 17 00:00:00 2001 From: ccubed Date: Sat, 30 Mar 2024 02:03:15 -0400 Subject: [PATCH 1/2] Setup Woodpecker CI Still just Woodpecker --- .woodpecker.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .woodpecker.yaml diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 0000000..94f2859 --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,44 @@ +steps: + - name: build-release + image: alpine + secrets: [GITEA_TOKEN] + when: + - event: push + - branch: main + commands: + - apk add openjdk21 + - apk add wget + - apk add tar + - wget https://github.com/demonnic/muddler/releases/download/0.13/muddle-shadow-0.13.tar + - tar -xvf muddle-shadow-0.13.tar + - mv muddle-shadow-0.13/lib/muddle-0.13-all.jar muddle.jar + - java -jar muddle.jar + + - name: deploy-build + image: alpine + when: + - event: [push, tag] + environment: + GITEATKN: + from_secret: GITEA_TOKEN + GOTOKEN: + from_secret: GOTIFY_TOKEN + depends_on: build-release + commands: + - apk add tea + - apk add wget + - tea login add --name=temp --url=https://git.vertinext.com/ --token=$GITEATKN + - tea releases create --asset "build/lotj-ui.mpackage" --asset "build/lotj-ui.xml" --tag latest --title "Latest Compiled Release" + - wget "https://gotify.vertinext.com/message?token=$GOTOKEN" --post-data "title=${CI} - ${CI_REPO_NAME}&message=New release ${CI_COMMIT_TAG} built and deployed.&priority=0" -O /dev/null + + - name: notify-on-branch-push + image: alpine + when: + - event: push + - status: [success, failure] + environment: + GOTOKEN: + from_secret: GOTIFY_TOKEN + commands: + - apk add wget + - wget "https://gotify.vertinext.com/message?token=$GOTOKEN" --post-data "title=${CI} - ${CI_REPO_NAME}&message=New pipeline running.&priority=0" -O /dev/null \ No newline at end of file From 2119809d2a105ed0d034fd5af933aa9b2bbd866c Mon Sep 17 00:00:00 2001 From: ccubed Date: Sat, 30 Mar 2024 04:23:50 -0400 Subject: [PATCH 2/2] Fine tuning --- .woodpecker.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 94f2859..1c43c4e 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -1,10 +1,8 @@ steps: - name: build-release image: alpine - secrets: [GITEA_TOKEN] when: - - event: push - - branch: main + - event: tag commands: - apk add openjdk21 - apk add wget @@ -17,7 +15,7 @@ steps: - name: deploy-build image: alpine when: - - event: [push, tag] + - event: tag environment: GITEATKN: from_secret: GITEA_TOKEN @@ -28,17 +26,17 @@ steps: - apk add tea - apk add wget - tea login add --name=temp --url=https://git.vertinext.com/ --token=$GITEATKN - - tea releases create --asset "build/lotj-ui.mpackage" --asset "build/lotj-ui.xml" --tag latest --title "Latest Compiled Release" + - tea releases create --asset "build/lotj-ui.mpackage" --asset "build/lotj-ui.xml" --tag ${CI_COMMIT_TAG} --title "Latest Compiled Release" --note "Use .mpackage for Mudlet and .xml for Mushclient" - wget "https://gotify.vertinext.com/message?token=$GOTOKEN" --post-data "title=${CI} - ${CI_REPO_NAME}&message=New release ${CI_COMMIT_TAG} built and deployed.&priority=0" -O /dev/null - name: notify-on-branch-push image: alpine when: - - event: push + - event: [push, pull_request, tag, release] - status: [success, failure] environment: GOTOKEN: from_secret: GOTIFY_TOKEN commands: - apk add wget - - wget "https://gotify.vertinext.com/message?token=$GOTOKEN" --post-data "title=${CI} - ${CI_REPO_NAME}&message=New pipeline running.&priority=0" -O /dev/null \ No newline at end of file + - wget "https://gotify.vertinext.com/message?token=$GOTOKEN" --post-data "title=${CI} - ${CI_REPO_NAME}&message=New ${CI_PIPELINE_EVENT} to ${CI_REPO_NAME}/${CI_COMMIT_BRANCH}.&priority=0" -O /dev/null \ No newline at end of file