Changed CI Workflow

This commit is contained in:
Phil 2023-08-20 18:28:06 +02:00
parent 98cc61e60a
commit cba5b23686
2 changed files with 72 additions and 7 deletions

View file

@ -27,7 +27,36 @@ steps:
- chmod +x ci-dependencies.sh - chmod +x ci-dependencies.sh
- chmod +x build.sh - chmod +x build.sh
- ./ci-dependencies.sh - ./ci-dependencies.sh
- sh build.sh - bash build.sh
- name: Release_binary s3 (test)
image: plugins/s3
settings:
endpoint: https://s3.hackmi.ch
bucket: amogusspecialsauce
access_key:
from_secret: access_key
secret_key:
from_secret: secret_key
source: dist/*
target: /b/main
steps:
- name: discord notification
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: webhook_id
webhook_token:
from_secret: webhook_token
message: >
{{#success build.status}}
Test-Build {{build.number}} succeeded.
Download: https://s3.hackmi.ch/amogusspecialsauce/b/main/compiled-${DRONE_COMMIT_SHA:0:10}.zip
{{else}}
Test-Build {{build.number}} failed.
See: {{build.link}}
{{/success}}
trigger: trigger:
branch: branch:
@ -64,9 +93,9 @@ steps:
- chmod +x ci-dependencies.sh - chmod +x ci-dependencies.sh
- chmod +x build.sh - chmod +x build.sh
- ./ci-dependencies.sh - ./ci-dependencies.sh
- sh build.sh - bash build.sh
- name: Release_binary (amd64,prod) - name: Release_binary git (prod)
image: plugins/gitea-release image: plugins/gitea-release
settings: settings:
api_key: api_key:
@ -75,6 +104,35 @@ steps:
files: dist/* files: dist/*
checksum: md5,sha256 checksum: md5,sha256
- name: Release_binary s3 (prod)
image: plugins/s3
settings:
endpoint: https://s3.hackmi.ch
bucket: amogusspecialsauce
access_key:
from_secret: access_key
secret_key:
from_secret: secret_key
source: dist/*
target: /releases
steps:
- name: discord notification
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: webhook_id
webhook_token:
from_secret: webhook_token
message: >
{{#success build.status}}
Test-Build {{build.number}} succeeded.
Download: https://s3.hackmi.ch/amogusspecialsauce/releases/compiled-${DRONE_TAG}.zip
{{else}}
Test-Build {{build.number}} failed.
See: {{build.link}}
{{/success}}
trigger: trigger:
event: event:
- tag - tag

View file

@ -1,4 +1,4 @@
#!/bin/ash #!/bin/bash
base=xonotic-data.pk3dir base=xonotic-data.pk3dir
# Apply specialsauce # Apply specialsauce
@ -19,8 +19,15 @@ mkdir -vp $(dirname "$0")/compiled
mv -v *.dat $(dirname "$0")/compiled mv -v *.dat $(dirname "$0")/compiled
rm *.lno rm *.lno
mkdir dist mkdir dist
if [[ -z "${DRONE_TAG}" ]]; then if [[ -n "${DRONE_TAG}" ]]
then
echo "Making ready for Tag: $DRONE_TAG"
zip -9 dist/compiled-$DRONE_TAG.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat zip -9 dist/compiled-$DRONE_TAG.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat
elif [[ -n "${DRONE_COMMIT_SHA}" ]]
then
COMMIT_SHA = ${DRONE_COMMIT_SHA:0:10}
echo "Making ready for Commit: $COMMIT_SHA"
zip -9 dist/compiled-$COMMIT_SHA.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat
else else
zip -9 dist/compiled.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat zip -9 dist/compiled.zip compiled/csprogs.dat compiled/progs.dat compiled/menu.dat
fi fi