Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
hatersgit committed Oct 23, 2023
2 parents f7e0f2a + 60e2751 commit b524c67
Show file tree
Hide file tree
Showing 360 changed files with 13,623 additions and 7,696 deletions.
39 changes: 39 additions & 0 deletions .github/actions/docker-tag-and-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: docker tag and build
description: a helper action to shorten generating docker tags and building
inputs:
component-name:
description: name of the component/docker image (eg worldserver, authserver)
type: string
required: true
push:
description: whether to push the image or not
type: boolean
required: true
version:
description: version tag to use for docker image
required: true
type: string
runs:
using: composite
steps:
- name: Get Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: acore/ac-wotlk-${{ inputs.component-name }}
tags: |
type=raw,value=${{ inputs.version }}
type=ref,event=branch
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ github.workspace }}
file: apps/docker/Dockerfile
push: ${{ inputs.push }}
tags: ${{ steps.meta.outputs.tags }}
target: ${{ inputs.component-name }}
build-args: |
USER_ID=1000
GROUP_ID=1000
DOCKER_USER=acore
2 changes: 1 addition & 1 deletion .github/workflows/build_dbimport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
COMPILER: ${{ matrix.compiler }}
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/check_pending_sql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
jobs:
check-pending-sql:
runs-on: ubuntu-latest
if: github.repository == 'azerothcore/azerothcore-wotlk'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check pending SQL
run: source ./apps/ci/ci-pending.sh
3 changes: 2 additions & 1 deletion .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ jobs:
matrix:
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
if: github.repository == 'azerothcore/azerothcore-wotlk'
name: check codestyle
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check core codestyle
run: source ./apps/ci/ci-codestyle.sh
2 changes: 1 addition & 1 deletion .github/workflows/core_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
COMPILER: ${{ matrix.compiler }}
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core_matrix_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
|| github.event.label.name == 'run-build')
)
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core_modules_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
|| github.event.label.name == 'run-build')
)
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout modules
run: ./apps/ci/ci-install-modules.sh
if: matrix.modules == 'with'
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/cpp-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ jobs:
if: github.repository == 'azerothcore/azerothcore-wotlk'
name: cpp check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: cpp check
run: |
sudo apt update -y
sudo apt install -y cppcheck
cppcheck --force --inline-suppr \
-i src/server/game/Achievements/AchievementMgr.cpp \
-i src/server/game/AuctionHouse/AuctionHouseMgr.cpp \
-i src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp \
-i src/server/game/DungeonFinding/LFGMgr.cpp \
-i src/server/game/Entities/GameObject/GameObject.cpp \
-i src/server/game/Entities/Pet/Pet.cpp \
-i src/server/game/Entities/Player/Player.cpp \
src/
cppcheck --force --inline-suppr --suppressions-list=./.suppress.cppcheck src/ --output-file=report.txt
if [ -s report.txt ]; then # if file is not empty
cat report.txt
exit 1 # let github action fails
fi
206 changes: 99 additions & 107 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,174 +4,166 @@ on:
branches:
- 'master'
pull_request:
types: ['labeled', 'opened', 'synchronize', 'reopened']
types:
- labeled
- opened
- synchronize
- reopened

concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
cancel-in-progress: true

jobs:
docker-build-n-deploy-dev:
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"
if: |
github.repository == 'azerothcore/azerothcore-wotlk'
&& !github.event.pull_request.draft
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
&& (github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1

steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Configure
- name: Free up disk space
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker --version
docker compose version
- uses: actions/checkout@v3
# we need the entire history for the ac-dev-server
# with:
# fetch-depth: 2
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v4

- name: Login to Docker Hub
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Dev
if: github.repository == 'azerothcore/azerothcore-wotlk'
env:
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
DOCKER_CLIENT_TIMEOUT: 400
COMPOSE_HTTP_TIMEOUT: 400
run: |
export DOCKER_USER_ID=$(id -u)
export DOCKER_GROUP_ID=$(id -u)
# pull the images first to load the docker cache layers
#./acore.sh docker pull
./acore.sh docker build
output=$(./acore.sh version | grep "AzerothCore Rev. ") && version=${output#"AzerothCore Rev. "}
DOCKER_IMAGE_TAG=$version docker compose --profile dev --profile local build
- name: Deploy Dev
#env:
# DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
- name: Get version
id: version
run: |
docker compose --profile dev --profile local push
output=$(./acore.sh version | grep "AzerothCore Rev. ") && version=${output#"AzerothCore Rev. "}
DOCKER_IMAGE_TAG=$version docker compose --profile dev --profile local push
output=$(./acore.sh version | grep "AzerothCore Rev. ")
version=${output#"AzerothCore Rev. "}
echo "version=$version" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: acore/ac-wotlk-dev-server
tags: |
type=raw,value=${{ steps.version.outputs.version }}
type=ref,event=branch
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ github.workspace }}
file: apps/docker/Dockerfile.dev-server
push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
USER_ID=1000
GROUP_ID=1000
DOCKER_USER=acore
# TODO: rename this job
docker-build-n-deploy-prod:
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"
if: |
github.repository == 'azerothcore/azerothcore-wotlk'
&& !github.event.pull_request.draft
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
&& (github.ref_name == 'master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1

steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Configure
- name: Free up disk space
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker --version
docker compose version
- uses: actions/checkout@v3
# we need the entire history for the ac-dev-server
# with:
# fetch-depth: 2
- uses: actions/checkout@v4

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# The containers created in this workflow are used by
# acore-docker, which has a dependency on mod-eluna.
#
# If you're wanting containers without mod-eluna, the best solution is to
# build them locally (such as with `docker compose build`)
- name: Download Eluna
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
uses: actions/checkout@v4
with:
repository: azerothcore/mod-eluna
path: modules/mod-eluna

- name: Login to Docker Hub
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Cache
uses: actions/cache@v3
with:
path: var/docker/ccache
key: ccache:${{ matrix.os }}:clang:without-modules:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ matrix.os }}:clang:without-modules:${{ github.ref }}
ccache:${{ matrix.os }}:clang:without-modules
- name: Build Production images
if: github.repository == 'azerothcore/azerothcore-wotlk'
env:
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
DOCKER_CLIENT_TIMEOUT: 220
COMPOSE_HTTP_TIMEOUT: 220
run: |
export DOCKER_USER_ID=$(id -u)
export DOCKER_GROUP_ID=$(id -u)
# pull the images first to load the docker cache layers
#./acore.sh docker prod:pull
./acore.sh docker prod:build
output=$(./acore.sh version | grep "AzerothCore Rev. ") && version=${output#"AzerothCore Rev. "}
DOCKER_IMAGE_TAG=$version ./acore.sh docker prod:build
# create the container to allow the copy right after
docker compose create ac-build-prod
docker compose cp ac-build-prod:/azerothcore/var/ccache var/docker/
echo "ccache exported"
- name: Deploy Production images
#env:
# DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
- name: Get version
id: version
run: |
docker compose --profile prod push
output=$(./acore.sh version | grep "AzerothCore Rev. ") && version=${output#"AzerothCore Rev. "}
DOCKER_IMAGE_TAG=$version docker compose --profile prod push
output=$(./acore.sh version | grep "AzerothCore Rev. ")
version=${output#"AzerothCore Rev. "}
echo "version=$version" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: build worldserver
uses: ./.github/actions/docker-tag-and-build
with:
component-name: worldserver
version: ${{ steps.version.outputs.version }}
push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }}

- name: build authserver
uses: ./.github/actions/docker-tag-and-build
with:
component-name: authserver
version: ${{ steps.version.outputs.version }}
push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }}

- name: build db-import
uses: ./.github/actions/docker-tag-and-build
with:
component-name: db-import
version: ${{ steps.version.outputs.version }}
push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }}

- name: build client-data
uses: ./.github/actions/docker-tag-and-build
with:
component-name: client-data
version: ${{ steps.version.outputs.version }}
push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }}

- name: build tools
uses: ./.github/actions/docker-tag-and-build
with:
component-name: tools
version: ${{ steps.version.outputs.version }}
push: ${{ github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master' }}

dispatch-acore-docker:
needs: [ docker-build-n-deploy-prod , docker-build-n-deploy-dev]
runs-on: ubuntu-latest
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Repository Dispatch
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
if: github.repository == 'azerothcore/azerothcore-wotlk' && github.ref_name == 'master'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.ACORE_DOCKER_REPO_ACCESS_TOKEN }}
Expand Down
Loading

0 comments on commit b524c67

Please sign in to comment.