Skip to content

Commit

Permalink
Fix GHA builds (#2)
Browse files Browse the repository at this point in the history
Fix GHA builds

Co-authored-by: Renato Foot Guimarães Costallat <[email protected]>
  • Loading branch information
dudantas and Costallat authored Apr 28, 2021
1 parent fe404e5 commit 2ddf9ef
Show file tree
Hide file tree
Showing 39 changed files with 88 additions and 143 deletions.
8 changes: 4 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ before_build:
cmake --build . --config Release
build:
project: C:\projects\otservbr-global\build\otbr.sln
project: C:\projects\canary\build\canary.sln
verbosity: minimal
parallel: true

after_build:
- cd %APPVEYOR_BUILD_FOLDER%\build\bin
- 7z a -tzip otservbr-global.zip Release\
- 7z a -tzip canary.zip Release\

cache:
- C:\projects\otservbr-global\build\vcpkg_installed\
- C:\projects\canary\build\vcpkg_installed\
- C:\Users\appveyor\AppData\Local\vcpkg\archives

artifacts:
- path: \build\bin\otservbr-global.zip
- path: \build\bin\canary.zip
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/i-want-to-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: I have a snippet to share
about: If you have any lua, xml or cpp code that you want to share to be added to the server
---

If you have a piece of code to contribute and want to share with OTServBR, **please do it with a pull request instead**. Refrain from opening issues for simple code changes, it makes everything slower while you could be contributing to the community and improving the life of every player that uses this server.
If you have a piece of code to contribute and want to share with Canary, **please do it with a pull request instead**. Refrain from opening issues for simple code changes, it makes everything slower while you could be contributing to the community and improving the life of every player that uses this server.

If you don't know how to contribute in GitHub, you don't even need to know Git: can try to edit the files that you want to change directly from the web interface. If you need to change more files you need to create a complete pull request, [you can learn how to do that with this tutorial](https://github.com/firstcontributions/first-contributions).

Expand Down
36 changes: 8 additions & 28 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,7 @@

name: Build on Ubuntu

on:
push:
branches:
- master
- develop
- v*

tags:
- v*

pull_request:
paths:
- cmake/**
- src/**
- CMakeLists.txt
- .github/**
on: [push, pull_request]

jobs:
job:
Expand Down Expand Up @@ -60,7 +45,7 @@ jobs:
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
vcpkgTriplet: ${{ matrix.triplet }}
additionalCachedPaths: ${{ github.workspace }}/build/vcpkg_installed
vcpkgGitCommitId: ${{ secrets.VCPKG_ID }}
vcpkgGitCommitId: b9cd2a7958dec657fb869ec487d2a98cf39a8d48

- name: 'Run CMake with Ninja, install dependencies with vcpkg, build with CMake'
uses: lukka/run-cmake@v3
Expand All @@ -71,25 +56,20 @@ jobs:
cmakeBuildType: ${{ matrix.buildtype }}

- name: Clean workspace
if: ${{ matrix.buildtype == 'Release' }}
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
shell: bash
run: |
mv ${{ github.workspace }}/build/bin/otbr ${{ github.workspace }}/otbr
find . -maxdepth 1 ! -name otbr ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \;
mv ${{ github.workspace }}/build/bin/canary ${{ github.workspace }}/canary
find . -maxdepth 1 ! -name canary ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \;
- name: Prepare datapack contents
if: ${{ matrix.buildtype == 'Release' }}
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
shell: bash
run: |
mv config.lua.dist config.lua
unzip -o data/world/world.zip -d data/world/
rm data/world/world.zip
cd ..
zip -r otservbr.zip otservbr-global
- name: Upload binary
if: ${{ matrix.buildtype == 'Release' }}
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-otbr-amd64-${{ matrix.buildtype }}-${{ github.sha }}
path: ${{ runner.workspace }}/otservbr.zip
name: ${{ matrix.os }}-canary-amd64-${{ matrix.buildtype }}-${{ github.sha }}
29 changes: 7 additions & 22 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,7 @@

name: Build on Windows

on:
push:
branches:
- master
- develop
- v*

tags:
- v*

pull_request:
paths:
- cmake/**
- src/**
- CMakeLists.txt
- .github/**
on: [push, pull_request]

jobs:
job:
Expand Down Expand Up @@ -51,7 +36,7 @@ jobs:
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
vcpkgTriplet: ${{ matrix.triplet }}
additionalCachedPaths: ${{ github.workspace }}/build/vcpkg_installed
vcpkgGitCommitId: ${{ secrets.VCPKG_ID }}
vcpkgGitCommitId: b9cd2a7958dec657fb869ec487d2a98cf39a8d48

- name: Run CMake to install the dependencies specified in the vcpkg.json manifest, generate project file and build the project
uses: lukka/run-cmake@v3
Expand All @@ -62,16 +47,16 @@ jobs:
buildWithCMake: true

- name: Copy artifacts
if: ${{ matrix.buildtype == 'Release' }}
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
shell: pwsh
run: |
Copy-Item -Path ${{ github.workspace }}\build\bin\* -Destination ${{ github.workspace }} -Recurse
- name: Create and Upload Full Datapack
if: ${{ matrix.buildtype == 'Release' }}
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
uses: actions/upload-artifact@v2
with:
name: otbr-full-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
name: canary-full-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
path: |
${{ github.workspace }}
!${{ github.workspace }}/build/
Expand All @@ -89,9 +74,9 @@ jobs:
!${{ github.workspace }}/Jenkinsfile
- name: Create and Upload Server Only
if: ${{ matrix.buildtype == 'Release' }}
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
uses: actions/upload-artifact@v2
with:
name: otbr-server-only-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
name: canary-server-only-${{ matrix.os }}-${{ matrix.buildtype }}-${{ github.sha }}
path: |
${{ github.workspace }}/build/bin/
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
vcpkgTriplet: ${{ matrix.triplet }}
additionalCachedPaths: ${{ github.workspace }}/build/vcpkg_installed
vcpkgGitCommitId: ${{ secrets.VCPKG_ID }}
vcpkgGitCommitId: b9cd2a7958dec657fb869ec487d2a98cf39a8d48

- name: 'Run CMake with Ninja, install dependencies with vcpkg, build with CMake'
if: ${{ matrix.language == 'cpp' }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ${{ runner.workspace }}/otservbr-global
cd ${{ runner.workspace }}/canary
cppcheck --version
$HOME/bin/reviewdog -reporter=github-pr-check -runners=cppcheck
Expand All @@ -53,22 +53,22 @@ jobs:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
luacheck --version
cd ${{ runner.workspace }}/otservbr-global
cd ${{ runner.workspace }}/canary
$HOME/bin/reviewdog -reporter=github-pr-check -runners=luacheck
- name: luac
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ${{ runner.workspace }}/otservbr-global
cd ${{ runner.workspace }}/canary
luac -v
$HOME/bin/reviewdog -reporter=github-pr-check -runners=luac
- name: xmllint
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd ${{ runner.workspace }}/otservbr-global
cd ${{ runner.workspace }}/canary
xmllint --version
$HOME/bin/reviewdog -reporter=github-pr-check -runners=xmllint
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ config.lua
sftp-config.json

# Binaries
otbr
otbr.old
canary
canary.old

# VCPKG
vcpkg_installed
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install:
- ./vcpkg/vcpkg integrate install

script:
- cd /home/travis/build/opentibiabr/otservbr-global
- cd /home/travis/build/opentibiabr/canary
- export CXXFLAGS="$CXXFLAGS -DBOOST_ASIO_DISABLE_NOEXCEPT=1 "
- /home/travis/build/opentibiabr/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install
- mkdir build
Expand All @@ -47,7 +47,7 @@ script:
- sonar-scanner -Dsonar.cfamily.cache.enabled=true -Dsonar.cfamily.cache.path=${TRAVIS_HOME}/.cfamily -Dsonar.cfamily.threads=${NUMBER_OF_PROCESSORS} || true

# - sonar-scanner -Dsonar.cfamily.cache.enabled=true -Dsonar.cfamily.cache.path=${TRAVIS_HOME}/.cfamily -Dsonar.cfamily.threads=${NUMBER_OF_PROCESSORS} || true
# - curl --upload-file /home/travis/build/opentibiabr/otservbr-global/sonar-cfamily-reproducer.zip https://transfer.sh/sonar-cfamily-reproducer.zip
# - curl --upload-file /home/travis/build/opentibiabr/canary/sonar-cfamily-reproducer.zip https://transfer.sh/sonar-cfamily-reproducer.zip

cache:
directories:
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ set(VCPKG_FEATURE_FLAGS "versions")
set(VCPKG_BUILD_TYPE "release")

# *****************************************************************************
# Project otbr
# Project canary
# *****************************************************************************
project(otbr)
project(canary)


# *****************************************************************************
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# OTServ Brasil - Global Server

[![Discord Channel](https://img.shields.io/discord/528117503952551936.svg?style=flat-square&logo=discord)](https://discord.gg/3NxYnyV)
[![GitHub issues](https://img.shields.io/github/issues/opentibiabr/otservbr-global)](https://github.com/opentibiabr/otservbr-global/issues)
[![GitHub pull request](https://img.shields.io/github/issues-pr/opentibiabr/otservbr-global)](https://github.com/opentibiabr/otservbr-global/pulls)
[![Contributors](https://img.shields.io/github/contributors/opentibiabr/otservbr-global.svg?style=flat-square)](https://github.com/opentibiabr/otservbr-global/graphs/contributors)
[![GitHub](https://img.shields.io/github/license/opentibiabr/otservbr-global)](https://github.com/opentibiabr/otservbr-global/blob/develop/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/opentibiabr/canary)](https://github.com/opentibiabr/canary/issues)
[![GitHub pull request](https://img.shields.io/github/issues-pr/opentibiabr/canary)](https://github.com/opentibiabr/canary/pulls)
[![Contributors](https://img.shields.io/github/contributors/opentibiabr/canary.svg?style=flat-square)](https://github.com/opentibiabr/canary/graphs/contributors)
[![GitHub](https://img.shields.io/github/license/opentibiabr/canary)](https://github.com/opentibiabr/canary/blob/develop/LICENSE)

![GitHub repo size](https://img.shields.io/github/repo-size/opentibiabr/otservbr-global)
![GitHub repo size](https://img.shields.io/github/repo-size/opentibiabr/canary)

[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a71728d523ac4b23a9c0b974ae4ec5df)](https://www.codacy.com/gh/opentibiabr/otservbr-global/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=opentibiabr/otservbr-global&amp;utm_campaign=Badge_Grade)
[![CodeQL](https://github.com/opentibiabr/otservbr-global/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/opentibiabr/otservbr-global/actions/workflows/codeql-analysis.yml)
[![Codacy Security Scan](https://github.com/opentibiabr/otservbr-global/actions/workflows/codacy-analysis.yml/badge.svg)](https://github.com/opentibiabr/otservbr-global/actions/workflows/codacy-analysis.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a71728d523ac4b23a9c0b974ae4ec5df)](https://www.codacy.com/gh/opentibiabr/canary/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=opentibiabr/canary&amp;utm_campaign=Badge_Grade)
[![CodeQL](https://github.com/opentibiabr/canary/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/opentibiabr/canary/actions/workflows/codeql-analysis.yml)
[![Codacy Security Scan](https://github.com/opentibiabr/canary/actions/workflows/codacy-analysis.yml/badge.svg)](https://github.com/opentibiabr/canary/actions/workflows/codacy-analysis.yml)

## Builds

[![Build status](https://ci.appveyor.com/api/projects/status/github/opentibiabr/otservbr-global?branch=develop&passingText=develop%20-%20OK&svg=true)](https://ci.appveyor.com/project/opentibiabr/otservbr-global/build/artifacts "Download nightly builds for Windows")
[![Build status](https://ci.appveyor.com/api/projects/status/github/opentibiabr/canary?branch=develop&passingText=develop%20-%20OK&svg=true)](https://ci.appveyor.com/project/opentibiabr/canary/build/artifacts "Download nightly builds for Windows")

[![Build on Ubuntu](https://github.com/opentibiabr/otservbr-global/workflows/Build%20on%20Ubuntu/badge.svg)](https://github.com/opentibiabr/otservbr-global/actions?query=workflow%3A%22Build+on+Ubuntu%22)
[![Build on Windows](https://github.com/opentibiabr/otservbr-global/workflows/Build%20on%20Windows/badge.svg)](https://github.com/opentibiabr/otservbr-global/actions?query=workflow%3A%22Build+on+Windows%22)
[![Build on Ubuntu](https://github.com/opentibiabr/canary/workflows/Build%20on%20Ubuntu/badge.svg)](https://github.com/opentibiabr/canary/actions?query=workflow%3A%22Build+on+Ubuntu%22)
[![Build on Windows](https://github.com/opentibiabr/canary/workflows/Build%20on%20Windows/badge.svg)](https://github.com/opentibiabr/canary/actions?query=workflow%3A%22Build+on+Windows%22)

## Project

OTServ Brasil - Global Server is a free and open-source MMORPG server emulator written in C++. It is a fork of the [Forgotten Server](https://github.com/otland/forgottenserver) project. To connect to the server and to take a stable experience, you can use our [own client](https://forums.otserv.com.br/index.php?/forums/topic/167933-otservbr-global-cliente-tibia-12/) and if you want to edit something, check our [customized tools](https://github.com/opentibiabr/tools).
OTServ Brasil - Global Server is a free and open-source MMORPG server emulator written in C++. It is a fork of the [Forgotten Server](https://github.com/otland/forgottenserver) project. To connect to the server and to take a stable experience, you can use our [own client](https://forums.otserv.com.br/index.php?/forums/topic/167933-canary-cliente-tibia-12/) and if you want to edit something, check our [customized tools](https://github.com/opentibiabr/tools).

You are subject to our code of conduct, read at [this link](https://github.com/opentibiabr/otservbr-global/blob/develop/CODE_OF_CONDUCT.md).
You are subject to our code of conduct, read at [this link](https://github.com/opentibiabr/canary/blob/develop/CODE_OF_CONDUCT.md).

### Getting **Started**

* **WARNING: YOU NEED TO UNZIP THE MAP BEFORE START THE SERVER.**
* [Compiling on Windows](https://forums.otserv.com.br/index.php?/forums/topic/169235-windowsvc2019-compilando-sources-otservbr-global/), alternatively if you are ****not** going to change anything on the source** you can download the latest compiled version for windows from [nightly builds for Windows](https://ci.appveyor.com/project/opentibiabr/otservbr-global/build/artifacts).
* Wiki: Compiling ([Ubuntu/Debian](https://github.com/opentibiabr/otservbr-global/wiki/Compiling-on-Ubuntu-or-Debian-GNU-Linux), [Windows](https://github.com/opentibiabr/otservbr-global/wiki/Compiling-on-Windows-(vcpkg)))
* [Compiling on Windows](https://forums.otserv.com.br/index.php?/forums/topic/169235-windowsvc2019-compilando-sources-canary/), alternatively if you are ****not** going to change anything on the source** you can download the latest compiled version for windows from [nightly builds for Windows](https://ci.appveyor.com/project/opentibiabr/canary/build/artifacts).
* Wiki: Compiling ([Ubuntu/Debian](https://github.com/opentibiabr/canary/wiki/Compiling-on-Ubuntu-or-Debian-GNU-Linux), [Windows](https://github.com/opentibiabr/canary/wiki/Compiling-on-Windows-(vcpkg)))

### Issues

We use the [issue tracker on GitHub](https://github.com/opentibiabr/OTServBR-Global/issues). Keep in mind that everyone who is watching the repository gets notified by e-mail when there is an activity, so be thoughtful and avoid writing comments that aren't meant for an issue (e.g. "+1"). If you'd like for an issue to be fixed faster, you should either fix it yourself and submit a pull request, or place a bounty on the issue.
We use the [issue tracker on GitHub](https://github.com/opentibiabr/canary/issues). Keep in mind that everyone who is watching the repository gets notified by e-mail when there is an activity, so be thoughtful and avoid writing comments that aren't meant for an issue (e.g. "+1"). If you'd like for an issue to be fixed faster, you should either fix it yourself and submit a pull request, or place a bounty on the issue.

### Pull requests

Before [creating a pull request](https://github.com/opentibiabr/otservbr-global/pulls) please keep in mind:
Before [creating a pull request](https://github.com/opentibiabr/canary/pulls) please keep in mind:

* Do not send Pull Request changing the map, as we can't review the changes it's better to use our [Discord](https://discord.gg/3NxYnyV) to talk about or send the map changes to the responsible for updating it.
* Focus on fixing only one thing, mixing too much things on the same Pull Request make it harder to review, harder to test and if we need to revert the change it will remove other things together.
Expand All @@ -49,7 +49,7 @@ Before [creating a pull request](https://github.com/opentibiabr/otservbr-global/

* our partners
* our crew (majesty, gpedro, eduardo dantas, foot)
* [our contributors](https://github.com/opentibiabr/OTServBR-Global/graphs/contributors)
* [our contributors](https://github.com/opentibiabr/canary/graphs/contributors)
* [fear lucien](https://github.com/FearLucien)
* [cjaker](https://github.com/Eternal-Scripts)
* [slavidodo](https://github.com/slavidodo)
Expand Down
1 change: 1 addition & 0 deletions canary.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINICON ICON "canary.ico"
Binary file added cmake/canary.ico
Binary file not shown.
1 change: 1 addition & 0 deletions cmake/canary.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINICON ICON "canary.ico"
Binary file removed cmake/otservbr-global.ico
Binary file not shown.
1 change: 0 additions & 1 deletion cmake/otservbr-global.rc

This file was deleted.

4 changes: 2 additions & 2 deletions data/XML/events.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event name="Otservbr example 1" startdate="11/03/2020" enddate="11/30/2020" script="example.lua" >
<event name="Canary example 1" startdate="11/03/2020" enddate="11/30/2020" script="example.lua" >
<ingame exprate="250" lootrate="200" spawnrate="100" skillrate="200" />
<description description="Otserver br example 1 description double exp and a half, double loot !chance!, regular spawn and double skill" />
<colors colordark="#235c00" colorlight="#2d7400" />
<details displaypriority="6" isseasonal="0" specialevent="0" />
</event>
<event name="Otservbr example 2" startdate="10/2/2020" enddate="11/7/2020" script="example.lua" >
<event name="Canary example 2" startdate="10/2/2020" enddate="11/7/2020" script="example.lua" >
<ingame exprate="50" lootrate="300" spawnrate="150" skillrate="100" />
<description description="Otserver br example 2 description 50% less exp, triple loot !chance!, 50% faster spawn and regular skill" />
<colors colordark="#735D10" colorlight="#8B6D05" />
Expand Down
2 changes: 0 additions & 2 deletions data/lib/core/position.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-- Functions from The Forgotten Server
Position.directionOffset = {
[DIRECTION_NORTH] = {x = 0, y = -1},
[DIRECTION_EAST] = {x = 1, y = 0},
Expand Down Expand Up @@ -48,7 +47,6 @@ function Position:moveUpstairs()
return self
end

-- Functions from OTServBR-Global
function Position:isInRange(from, to)
-- No matter what corner from and to is, we want to make
-- life easier by calculating north-west and south-east
Expand Down
1 change: 0 additions & 1 deletion data/lib/core/tile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function Tile:isWalkable(pz, creature, floorchange, block, proj)
return true
end

-- Functions from OTServbr-Global
function Tile.isHouse(self)
local house = self:getHouse()
return not not house
Expand Down
Loading

0 comments on commit 2ddf9ef

Please sign in to comment.