Compare commits

...

60 Commits

Author SHA1 Message Date
Akkadius 158dd3ac97 Take #45354 2023-01-20 16:32:11 -06:00
Akkadius f5de63b1d7 Shuffle 2023-01-20 16:22:41 -06:00
Akkadius bf157eab7f Update build-release.bat 2023-01-20 16:16:09 -06:00
Akkadius 11fc66c490 Update build-release.bat 2023-01-20 16:11:14 -06:00
Akkadius f654fa6f58 Bump 2023-01-20 16:07:08 -06:00
Akkadius c75f731a82 Update CHANGELOG.md 2023-01-20 16:06:18 -06:00
Akkadius f29421a7d6 Test pipeline 2023-01-20 16:04:08 -06:00
Akkadius 0a6212f9a8 Update build-release.bat 2023-01-20 16:01:46 -06:00
Akkadius 84415b146b Update build-release.bat 2023-01-20 16:01:02 -06:00
Akkadius e4fe36088b Update .drone.yml 2023-01-20 15:59:56 -06:00
Akkadius 5aea91e680 Update .drone.yml 2023-01-20 15:58:29 -06:00
Akkadius 8d7cef6237 Update .drone.yml 2023-01-20 15:57:23 -06:00
Akkadius f65ab8d372 Update build-release.bat 2023-01-20 15:56:03 -06:00
Akkadius 217ea71bd7 Test 2023-01-20 15:54:17 -06:00
Akkadius d5f2669cab Update .drone.yml 2023-01-20 15:25:25 -06:00
Akkadius c49548c090 Update .drone.yml 2023-01-20 15:23:42 -06:00
Akkadius b615b4d474 Add version checks 2023-01-20 15:23:10 -06:00
Akkadius f151e5fbe3 Update .drone.yml 2023-01-20 14:24:25 -06:00
Akkadius 2835f79a9f Update .drone.yml 2023-01-20 14:21:00 -06:00
Akkadius 9fbdf1e7c0 exit 78 2023-01-20 14:19:21 -06:00
Akkadius 1c074ec84c Update .drone.yml 2023-01-20 14:14:52 -06:00
Akkadius aa953731ad Update .drone.yml 2023-01-20 14:02:15 -06:00
Akkadius 23ef6b9c8c Check if release 2023-01-20 13:59:10 -06:00
Akkadius 3655b1a350 Release bot test #2 2023-01-20 13:29:35 -06:00
Akkadius 9ff2d03d01 Bots release 22.0.5 (Test) 2023-01-20 13:28:54 -06:00
Akkadius eedba3949d Test 2023-01-20 13:28:54 -06:00
Akkadius 241e6e6823 Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius d00ab2233a Filter pipeline stage 2023-01-20 13:28:54 -06:00
Akkadius af03ac7df2 Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius 45c1a60684 Remove debug 2023-01-20 13:28:54 -06:00
Akkadius f3407f5972 Test pipeline 2023-01-20 13:28:54 -06:00
Akkadius e7b43b9e2f Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius cf6b97c745 Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius 26116ec808 Release without bots 2023-01-20 13:28:54 -06:00
Akkadius a6438b833c Yolo 2023-01-20 13:28:54 -06:00
Akkadius e840eeb931 Copy 2023-01-20 13:28:54 -06:00
Akkadius 6cd2cb20b5 Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius 440eb64328 Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius af0e64cef8 Yolo 2023-01-20 13:28:54 -06:00
Akkadius 2db28a7e42 Yolo 2023-01-20 13:28:54 -06:00
Akkadius 4bbad8678c Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius b6e5ef5521 Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius b22b281312 Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius b66c65fc02 Test upload 2023-01-20 13:28:54 -06:00
Akkadius 1c7dedb12d Naming 2023-01-20 13:28:54 -06:00
Akkadius e6dc06c0c6 Update .drone.yml 2023-01-20 13:28:54 -06:00
Akkadius c445f7bed6 Test 2023-01-20 13:28:54 -06:00
Akkadius 4e0b762244 Update .drone.yml 2023-01-20 13:28:53 -06:00
Akkadius 4f3c97ff24 Update .drone.yml 2023-01-20 13:28:53 -06:00
Akkadius c5d5bf6503 Update .drone.yml 2023-01-20 13:28:53 -06:00
Akkadius a76204bd38 Update .drone.yml 2023-01-20 13:28:53 -06:00
Akkadius d828c72176 Linux 2023-01-20 13:28:53 -06:00
Akkadius 60962005d1 Remove 7z from build scripts 2023-01-20 13:28:53 -06:00
Akkadius 2a81314d49 Split 2023-01-20 13:28:53 -06:00
Akkadius 9edad8fa3b Kill excessive warnings 2023-01-20 13:28:53 -06:00
Akkadius 74f8629884 Update windows-build.ps1 2023-01-20 13:28:53 -06:00
Akkadius 6f8fc85a92 Update windows-build.ps1 2023-01-20 13:28:53 -06:00
Akkadius 87af11374c Update windows-build.ps1 2023-01-20 13:28:53 -06:00
Akkadius 90366302bd Test 2023-01-20 13:28:53 -06:00
Akkadius 92df505c6e Test 2023-01-20 13:28:53 -06:00
13 changed files with 393 additions and 2 deletions
+143 -1
View File
@@ -10,7 +10,7 @@ concurrency:
volumes:
- name: cache
host:
path: /var/lib/cache
path: /var/lib/cache-debug
steps:
- name: server-build
@@ -25,3 +25,145 @@ steps:
volumes:
- name: cache
path: /home/eqemu/.ccache/
# remove this when merge
trigger:
branch:
- noop
event:
- push
---
kind: pipeline
type: docker
name: Build Linux Binaries
# Limits how many of these builds can run on the drone runner at a time, this isn't about cores
concurrency:
limit: 1
volumes:
- name: cache
host:
path: /var/lib/cache-release
steps:
- name: Init
image: akkadius/eqemu-server:v11
environment:
GITHUB_TOKEN:
from_secret: GH_RELEASE_GITHUB_API_TOKEN
commands:
- ./utils/scripts/build/should-release/should-release
- sudo chown eqemu:eqemu /drone/src/ * -R
- sudo chown eqemu:eqemu /home/eqemu/.ccache/ * -R
- git submodule init && git submodule update
volumes:
- name: cache
path: /home/eqemu/.ccache/
- name: Linux x64
image: akkadius/eqemu-server:v11
commands:
- mkdir -p build && cd build && cmake -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-Os" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
- curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
- ./bin/tests
volumes:
- name: cache
path: /home/eqemu/.ccache/
- name: Package Artifact
image: akkadius/eqemu-server:v11
commands:
- rm ./build/bin/*.a
- zip -j eqemu-server-linux-x64.zip ./build/bin/*
- ls -lsh | grep zip
volumes:
- name: cache
path: /home/eqemu/.ccache/
- name: Upload Artifact
image: akkadius/eqemu-build-releaser:v2
environment:
RCLONE_CONFIG_REMOTE_TYPE: ftp
RCLONE_FTP_HOST: drone.akkadius.com
RCLONE_FTP_USER: artifacts
RCLONE_FTP_PASS:
from_secret: RCLONE_FTP_PASS
commands:
- rclone config create remote ftp env_auth true > /dev/null
- |
rclone copy eqemu-server-linux-x64.zip remote:
- |
rclone ls remote:
trigger:
branch:
- akkadius/build-test
event:
- push
---
kind: pipeline
type: exec
name: Build Windows Binaries
platform:
os: windows
arch: amd64
steps:
- name: Build Windows X64 Release
environment:
RCLONE_CONFIG_REMOTE_TYPE: ftp
RCLONE_FTP_HOST: drone.akkadius.com
RCLONE_FTP_USER: artifacts
RCLONE_FTP_PASS:
from_secret: RCLONE_FTP_PASS
GITHUB_TOKEN:
from_secret: GH_RELEASE_GITHUB_API_TOKEN
commands:
- .\utils\scripts\build\windows-build.ps1
trigger:
branch:
- akkadius/build-test
event:
- push
---
kind: pipeline
type: docker
name: Publish Artifacts to Github
steps:
- name: Upload Artifacts
image: akkadius/eqemu-build-releaser:v3
environment:
RCLONE_CONFIG_REMOTE_TYPE: ftp
RCLONE_FTP_HOST: drone.akkadius.com
RCLONE_FTP_USER: artifacts
RCLONE_FTP_PASS:
from_secret: RCLONE_FTP_PASS
GH_RELEASE_GITHUB_API_TOKEN:
from_secret: GH_RELEASE_GITHUB_API_TOKEN
GITHUB_TOKEN:
from_secret: GH_RELEASE_GITHUB_API_TOKEN
commands:
- ./utils/scripts/build/should-release/should-release
- rclone config create remote ftp env_auth true > /dev/null
- |
rclone copy remote: --include "eqemu-server*.zip" .
- gh-release --assets=eqemu-server-linux-x64.zip,eqemu-server-windows-x64.zip -y
- |
rclone delete remote: --include "eqemu-server*.zip"
depends_on:
- Build Windows Binaries
- Build Linux Binaries
trigger:
branch:
- akkadius/build-test
event:
- push
+6 -1
View File
@@ -62,4 +62,9 @@ compile_flags.txt
.cache/
# vscode generated settings
.vscode/
.vscode/
# Build pipeline
!utils/scripts/build/
!utils/scripts/build/should-release/should-release
!utils/scripts/build/should-release/should-release.exe
+41
View File
@@ -0,0 +1,41 @@
## [22.0.7]
### Release Test
Release test
## [22.0.6]
### Release Test
Release test with bots #2
## [22.0.5]
### Release Test
Release test with bots
## [22.0.4]
### Release Test
Release test with smaller Linux bins
## [22.0.3]
### Release Test
Testing Linux build in release
## [22.0.2]
### Release Without Bots
Testing release without bots
## [22.0.1]
### Stable Releases
- Testing stable releases
+1
View File
@@ -23,6 +23,7 @@ IF(MSVC)
ADD_DEFINITIONS(-D_HAS_AUTO_PTR_ETC) # for Luabind on C++17
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ADD_DEFINITIONS( "/W0 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo ")
ELSE(MSVC)
ADD_DEFINITIONS(-DHAS_UNION_SEMUN)
ENDIF(MSVC)
+8
View File
@@ -0,0 +1,8 @@
{
"name": "eqemu-server",
"version": "22.0.7",
"repository": {
"type": "git",
"url": "https://github.com/EQEmu/Server.git"
}
}
+12
View File
@@ -0,0 +1,12 @@
git submodule init
git submodule update
.\utils\scripts\build\windows-build.ps1
.\utils\scripts\build\should-release\should-release.exe || echo Not releasing, exit gracefully && exit /b 0
Powershell.exe -executionpolicy remotesigned -File .\utils\scripts\build\package-artifacts.ps1
dir *.zip
rclone config create remote ftp env_auth true
rclone copy eqemu-server-windows-x64.zip remote:
rclone ls remote:
+24
View File
@@ -0,0 +1,24 @@
#############################################
# debian
#############################################
FROM debian:11-slim
#############################################
# basics
#############################################
RUN apt-get update && apt-get install -y \
rclone \
git \
make \
jq \
wget \
curl
#############################################
# node
#############################################
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash && \
apt-get update && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*
RUN npm install -g gh-release
+16
View File
@@ -0,0 +1,16 @@
module should-release
go 1.19
require (
github.com/google/go-github/v41 v41.0.0
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
)
require (
github.com/golang/protobuf v1.3.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
google.golang.org/appengine v1.6.7 // indirect
)
+29
View File
@@ -0,0 +1,29 @@
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg=
github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
@@ -0,0 +1,77 @@
package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/google/go-github/v41/github"
"golang.org/x/oauth2"
"log"
"net/http"
"os"
"path/filepath"
"strings"
)
type PackageJson struct {
Name string `json:"name"`
Version string `json:"version"`
Repository struct {
Type string `json:"type"`
URL string `json:"url"`
} `json:"repository"`
}
func main() {
// get latest release from github
client := github.NewClient(nil)
if len(os.Getenv("GITHUB_TOKEN")) > 0 {
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")},
)
tc := &http.Client{
Transport: &oauth2.Transport{
Source: ts,
},
}
client = github.NewClient(tc)
}
release, _, err := client.Repositories.GetLatestRelease(context.Background(), "EQEmu", "Server")
if err != nil {
log.Println(err)
os.Exit(1)
}
version := strings.ReplaceAll(*release.TagName, "v", "")
// get current version from package.json
currentLevel := filepath.Join("./package.json")
packageJsonFile := currentLevel
if _, err := os.Stat(currentLevel); errors.Is(err, os.ErrNotExist) {
packageJsonFile = ""
// this is only really needed when developing this binary
walkUpToRoot := filepath.Join("../../../../package.json")
if _, err := os.Stat(walkUpToRoot); err == nil {
// path/to/whatever exists
packageJsonFile = walkUpToRoot
}
}
if len(packageJsonFile) == 0 {
fmt.Printf("Could not find package.json\n")
os.Exit(1)
}
packageJson, err := os.ReadFile(packageJsonFile)
var p PackageJson
_ = json.Unmarshal(packageJson, &p)
// version compare
if p.Version == version {
fmt.Printf("Version [%v] already exists. No need to release\n", version)
fmt.Printf("Exiting code 78 to halt pipeline steps gracefully\n")
os.Exit(78)
}
}
Binary file not shown.
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
Try
{
$cwd = Get-Location
Set-Location -Path "$cwd"
git submodule init
git submodule update
if (![System.IO.Directory]::Exists("$cwd\win-build-x64"))
{
Write-Information -MessageData "Creating build x64 folder" -InformationAction Continue
New-Item -Path "$cwd\win-build-x64" -ItemType Directory
}
Write-Information -MessageData "Creating build x64" -InformationAction Continue
Set-Location -Path "$cwd\win-build-x64"
cmake -Wno-dev -G "Visual Studio 17 2022" -A x64 -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_ZLIB=ON "$cwd"
cmake --build . --config RelWithDebInfo --clean-first
Set-Location -Path "$cwd"
7z a eqemu-server-windows-x64.zip $cwd\win-build-x64\bin\RelWithDebInfo\*.exe $cwd\win-build-x64\bin\RelWithDebInfo\*.dll $cwd\win-build-x64\bin\RelWithDebInfo\*.pdb $cwd\win-build-x64\libs\zlibng\RelWithDebInfo\*.dll $cwd\win-build-x64\libs\zlibng\RelWithDebInfo\*.pdb
cmd.exe .\utils\scripts\build\should-release\should-release.exe
dir *.zip
rclone config create remote ftp env_auth true
rclone copy eqemu-server-windows-x64.zip remote:
rclone ls remote:
}
Catch
{
Write-Host ("Caught signal to end")
}