Skip to content

Commit

Permalink
refactor: split up altv package into multiple subpackages (#17)
Browse files Browse the repository at this point in the history
* refactor: split root package into smaller subpackages (WIP)

* fix(factory): player entity & factory

* chore(entity): disable base object tests

* refactor(entity): shorter BaseObjectType enums

* refactor: seperate io, import, export & permission

* fix(event): rename package events to event

* fix(mvalue): use current resource global var instead of resource name setter

* chore(readme): useful build information

* docs: contribution & troubleshooting guide

* refactor: remove connectionInfo interface

* feat(cmd): gencapi cli

* docs: update c-api build explanation

* chore: delete runtime/tools/pkg-capi.js (superseeded by cmd/gencapi)

* fix(cmd): gencapi snake case

* ci: publish go module on release & generate capi for go test

* ci: only run in prs or on tracked branches

* fix(scripts): windows capi build

* ci: fix windows capi generate

* ci: fix capi generate

* ci: fix go test matrix

* fix: some deep source code errors

* ci: attempt to fix capi gen permissions

* ci: attempt to fix permissions
  • Loading branch information
Timo972 authored Aug 31, 2023
1 parent e59dd31 commit 680c087
Show file tree
Hide file tree
Showing 67 changed files with 3,515 additions and 2,385 deletions.
106 changes: 0 additions & 106 deletions .github/workflows/build-c-api.yml

This file was deleted.

139 changes: 0 additions & 139 deletions .github/workflows/build-deploy-module.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/publish-module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish Go Module
on:
release:
types: [created]

jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive

- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Extract version
id: version
shell: bash
run: |
TAG=${GITHUB_REF/refs\/tags\//}
echo ::set-output name=TAG::${TAG}
echo ::set-output name=VERSION::${TAG#v}
- name: Build module for windows
if: matrix.os == 'windows-2019'
shell: cmd
run: |
mkdir build
pushd build
cmake -G"Visual Studio 16" -A x64 -DGO_MODULE_VERSION=%VERSION% ..
cmake --build . --config Release
popd
env:
VERSION: ${{ steps.version.outputs.VERSION }}
working-directory: ./runtime

- name: Build module for linux
if: matrix.os == 'ubuntu-20.04'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-8 g++-8
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-8 -DGO_MODULE_VERSION=%VERSION% ..
cmake --build . --config Release
env:
VERSION: ${{ steps.version.outputs.VERSION }}
working-directory: ./runtime

- name: Upload windows artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./runtime/bin/Release/go-module.dll
asset_name: go-module.dll
asset_content_type: application/x-msdownload

- name: Upload linux artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./runtime/bin/libgo-module.so
asset_name: libgo-module.so
asset_content_type: application/octet-stream
23 changes: 15 additions & 8 deletions .github/workflows/test-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ on:
push:
paths:
- "*.go"
- "internal/**"
- "events/**"
- "mvalue/**"
- "**/*.go"
- "go.mod"
- "go.sum"
branches:
- main
- dev
pull_request:
paths:
- "*.go"
- "internal/**"
- "events/**"
- "mvalue/**"
- "**/*.go"
- "go.mod"
- "go.sum"

Expand All @@ -22,6 +21,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: windows-latest
script_name: .\scripts\build-capi.bat
- os: ubuntu-latest
script_name: ./scripts/build-capi.sh
name: Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -35,13 +39,16 @@ jobs:
with:
go-version: '1.21.0'

- name: Generate C-API
run: ${{ matrix.script_name }}

- name: Test altv
run: go test
working-directory: .

- name: Test altv/events
- name: Test altv/event
run: go test
working-directory: ./events
working-directory: ./event

- name: Test altv/mvalue
run: go test
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
paths:
- "runtime/**"
branches:
- main
- dev
pull_request:
paths:
- "runtime/**"
Expand Down
Loading

0 comments on commit 680c087

Please sign in to comment.