mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
This commit is contained in:
parent
826a43a2ba
commit
36a3f8e18f
133
.drone.yml
133
.drone.yml
@ -1,121 +1,18 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: create-release
|
name: Create release
|
||||||
workspace:
|
|
||||||
path: /repo
|
|
||||||
#platform:
|
|
||||||
#os: linux
|
|
||||||
#arch: amd64
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: create
|
- name: Deploy to hosts
|
||||||
image: docker.panel2.viceunderdogs.com/buildenv:debian-latest
|
image: appleboy/drone-ssh:1.6.3-linux-amd64
|
||||||
environment:
|
settings:
|
||||||
GIT_TOKEN:
|
host:
|
||||||
from_secret: GITEA_KEY
|
- fatcow.thijn.ovh
|
||||||
commands:
|
- obesepig.thijn.ovh
|
||||||
- wget 'https://thijn.ovh/escape-newline.sh' -O /escape-newline.sh && chmod +x /escape-newline.sh
|
username: thijn
|
||||||
- echo RELEASE_TAG=$(git rev-parse --short HEAD) > /repo/.release.env
|
password:
|
||||||
- . /repo/.release.env
|
from_secret: ssh_password
|
||||||
- MESSAGE=$(echo $DRONE_COMMIT_MESSAGE | /escape-newline.sh)
|
port: 22
|
||||||
- >
|
script: >
|
||||||
echo RELEASE_ID=$(curl -s 'https://git.thijn.ovh/api/v1/repos/Thijn/SqMod/releases?token='"$GIT_TOKEN"'' -H 'accept: application/json' -H 'Content-Type: application/json' --data-binary '{"tag_name": "'"$RELEASE_TAG"'","body": "'"$MESSAGE"'","name": "Autobuild"}' | jq '.id') >> /repo/.release.env
|
cd /tmp &&
|
||||||
|
git pull &&
|
||||||
. /repo/.release.env
|
composer install --no-progress
|
||||||
|
|
||||||
echo "Created release $RELEASE_ID"
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: build-linux
|
|
||||||
workspace:
|
|
||||||
path: /repo
|
|
||||||
#platform:
|
|
||||||
#os: linux
|
|
||||||
#arch: amd64
|
|
||||||
depends_on:
|
|
||||||
- create-release
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: get-release
|
|
||||||
image: docker.panel2.viceunderdogs.com/buildenv:debian-latest
|
|
||||||
environment:
|
|
||||||
GIT_TOKEN:
|
|
||||||
from_secret: GITEA_KEY
|
|
||||||
commands:
|
|
||||||
- GIT_SHA=$(git rev-parse --short HEAD)
|
|
||||||
- >
|
|
||||||
echo "Git SHA: $GIT_SHA"
|
|
||||||
|
|
||||||
echo RELEASE_ID=$(curl -s 'https://git.thijn.ovh/api/v1/repos/Thijn/SqMod/releases/tags/'"$GIT_SHA"'?token='"$GIT_TOKEN"'' -H 'accept: application/json' -H 'Content-Type: application/json' | jq '.id') > /repo/.release.env
|
|
||||||
|
|
||||||
cat /repo/.release.env
|
|
||||||
|
|
||||||
- name: build-debian
|
|
||||||
image: docker.panel2.viceunderdogs.com/buildenv:debian-latest
|
|
||||||
environment:
|
|
||||||
GIT_TOKEN:
|
|
||||||
from_secret: GITEA_KEY
|
|
||||||
commands:
|
|
||||||
- . /repo/.release.env
|
|
||||||
- cat /repo/.release.env
|
|
||||||
- cd /repo && cmake -E make_directory /repo/build
|
|
||||||
- cd /repo/build && cmake /repo -DCMAKE_BUILD_TYPE=Release
|
|
||||||
- cmake --build /repo/build --config Release
|
|
||||||
- mv /repo/bin/plugins/mod_squirrel_64.so /repo/bin/plugins/mod_squirrel_64-debian.so
|
|
||||||
- >
|
|
||||||
curl -X 'POST' 'https://git.thijn.ovh/api/v1/repos/Thijn/SqMod/releases/'"$RELEASE_ID"'/assets?token='"$GIT_TOKEN"'' -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F 'attachment=@/repo/bin/plugins/mod_squirrel_64-debian.so'
|
|
||||||
|
|
||||||
- name: build-ubuntu
|
|
||||||
image: docker.panel2.viceunderdogs.com/buildenv:ubuntu-latest
|
|
||||||
environment:
|
|
||||||
GIT_TOKEN:
|
|
||||||
from_secret: GITEA_KEY
|
|
||||||
commands:
|
|
||||||
- . /repo/.release.env
|
|
||||||
- cd /repo && rm -rf /repo/build &&cmake -E make_directory /repo/build
|
|
||||||
- cd /repo/build && cmake /repo -DCMAKE_BUILD_TYPE=Release
|
|
||||||
- cmake --build /repo/build --config Release
|
|
||||||
- mv /repo/bin/plugins/mod_squirrel_64.so /repo/bin/plugins/mod_squirrel_64-ubuntu.so
|
|
||||||
- >
|
|
||||||
curl -X 'POST' 'https://git.thijn.ovh/api/v1/repos/Thijn/SqMod/releases/'"$RELEASE_ID"'/assets?token='"$GIT_TOKEN"'' -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F 'attachment=@/repo/bin/plugins/mod_squirrel_64-ubuntu.so'
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
|
|
||||||
#---
|
|
||||||
#kind: pipeline
|
|
||||||
#name: build-windows
|
|
||||||
#workspace:
|
|
||||||
# path: /repo
|
|
||||||
#platform:
|
|
||||||
# os: windows
|
|
||||||
# arch: amd64
|
|
||||||
# version: 1809
|
|
||||||
#depends_on:
|
|
||||||
# - create-release
|
|
||||||
|
|
||||||
#steps:
|
|
||||||
#- name: build
|
|
||||||
#image: docker.panel2.viceunderdogs.com/buildenv:windows-latest
|
|
||||||
#environment:
|
|
||||||
#CHERE_INVOKING: yes
|
|
||||||
#MSYSTEM: MINGW64
|
|
||||||
#GIT_TOKEN:
|
|
||||||
#from_secret: GITEA_KEY
|
|
||||||
#commands:
|
|
||||||
#- >
|
|
||||||
#mkdir build
|
|
||||||
#
|
|
||||||
#cd build
|
|
||||||
#
|
|
||||||
#C:\msys64\usr\bin\bash -lc 'wget https://thijn.ovh/sqmod/build-windows.sh'
|
|
||||||
#
|
|
||||||
#C:\msys64\usr\bin\bash -lc 'chmod +x build-windows.sh && ./build-windows.sh'
|
|
||||||
|
|
||||||
#trigger:
|
|
||||||
#event:
|
|
||||||
#- push
|
|
||||||
|
Loading…
Reference in New Issue
Block a user