Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
295 changes: 143 additions & 152 deletions .editorconfig

Large diffs are not rendered by default.

31 changes: 25 additions & 6 deletions .github/workflows/component-linux.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
name: CI - Component x64 Linux (Coming Soon)

# TODO: Update this workflow when component (x64) code is in src/sampsharp-component/
# For now, this is a placeholder.
name: CI - Component x64 (Linux)

on:
push:
Expand All @@ -11,16 +8,38 @@ on:
paths:
- .github/workflows/component-linux.yml
- src/sampsharp-component/**
- external/**
- build.sh

pull_request:
branches:
- master
- release/1.*
paths:
- .github/workflows/component-linux.yml
- src/sampsharp-component/**
- external/**
- build.sh

jobs:
placeholder:
build:
runs-on: ubuntu-latest

steps:
- run: echo "New component (x64) build on Linux - not yet implemented"
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y gcc g++ cmake

- name: Build component
run: ./build.sh component publish

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sampsharp-component-linux
path: build/artifacts/sampsharp-component/
26 changes: 0 additions & 26 deletions .github/workflows/component-win.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/component-win64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI - Component x64 (Windows)

on:
push:
branches:
- master
- release/1.*
paths:
- .github/workflows/component-win64.yml
- src/sampsharp-component/**
- external/**
- build.cmd

pull_request:
branches:
- master
- release/1.*
paths:
- .github/workflows/component-win64.yml
- src/sampsharp-component/**
- external/**
- build.cmd

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup CMake
uses: lukka/get-cmake@latest

- name: Build component
run: .\build.cmd component publish

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sampsharp-component-windows
path: build/artifacts/sampsharp-component/
50 changes: 50 additions & 0 deletions .github/workflows/dotnet-component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI - Component Libraries

on:
push:
branches:
- master
- release/1.*
paths:
- .github/workflows/dotnet-component.yml
- src/SampSharp.*/**
- src/TestMode.*/**
- SampSharp.sln
- Directory.Build.props
- build.sh

pull_request:
branches:
- master
- release/1.*
paths:
- .github/workflows/dotnet-component.yml
- src/SampSharp.*/**
- src/TestMode.*/**
- SampSharp.sln
- Directory.Build.props
- build.sh

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Build component libraries
run: ./build.sh component-libraries

- name: Pack component libraries
run: ./build.sh component-libraries publish

- name: Upload NuGet packages
uses: actions/upload-artifact@v4
with:
name: sampsharp-component-nuget-packages
path: build/artifacts/packages/
26 changes: 0 additions & 26 deletions .github/workflows/dotnet.yml

This file was deleted.

114 changes: 107 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,115 @@
name: Release - New SampSharp (Coming Soon)

# TODO: Update this workflow when new SampSharp code is ready for release
# For now, this is a placeholder.
name: Release - SampSharp

on:
push:
tags:
- '1.*'

jobs:
placeholder:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup CMake
uses: lukka/get-cmake@latest

- name: Build open.mp component
run: .\build.cmd component publish

- name: Upload Windows component
uses: actions/upload-artifact@v4
with:
name: component-windows
path: build/artifacts/sampsharp-component/

build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y gcc g++ cmake

- name: Build open.mp component
run: ./build.sh component publish

- name: Upload Linux component
uses: actions/upload-artifact@v4
with:
name: component-linux
path: build/artifacts/sampsharp-component/

release:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- run: echo "New SampSharp release workflow - not yet implemented"
- uses: actions/checkout@v4

- name: Set VERSION
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Download Windows component
uses: actions/download-artifact@v4
with:
name: component-windows
path: ./component-windows

- name: Download Linux component
uses: actions/download-artifact@v4
with:
name: component-linux
path: ./component-linux

- name: Create release package
run: |
mkdir -p SampSharp-${{ env.VERSION }}/components
cp component-windows/SampSharp.dll SampSharp-${{ env.VERSION }}/components/
cp component-linux/SampSharp.so SampSharp-${{ env.VERSION }}/components/SampSharp.so
zip -r SampSharp-${{ env.VERSION }}.zip SampSharp-${{ env.VERSION }}/

- name: Create Release
uses: actions/create-release@v1
id: create_release
with:
tag_name: ${{ github.ref }}
release_name: SampSharp ${{ env.VERSION }}
draft: true
prerelease: ${{ contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload component package
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: SampSharp-${{ env.VERSION }}.zip
asset_name: SampSharp-${{ env.VERSION }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Pack NuGet packages
run: ./build.sh component-libraries publish
env:
CiVersion: ${{ env.VERSION }}

- name: Publish to NuGet
run: |
for nupkg in build/artifacts/packages/*.nupkg; do
dotnet nuget push "$nupkg" \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_API_KEY }} \
--skip-duplicate
done
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Build and output
[Bb]in/
[Oo]bj/
build/
bin/
obj/
build_*/
publish/
PublishProfiles/
*.log

# IDE
Expand All @@ -11,9 +14,7 @@ obj/
*.user
*.suo
*.sln.DotSettings.user

# Publishing
PublishProfiles/
launchSettings.json

# OS
.DS_Store
Expand All @@ -24,4 +25,4 @@ desktop.ini
*~
*.tmp
*.swp
*.swo
*.swo
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "external/sdk"]
path = external/sdk
url = https://github.com/openmultiplayer/open.mp-sdk
branch = master
Loading
Loading