Skip to content

Commit

Permalink
Add GitHub Actions workflow for NuGet release
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Jan 28, 2024
1 parent 160e764 commit 1d77fd9
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 6 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: NuGet Release

on: [push, workflow_dispatch]

concurrency:
group: nuget-${{github.ref}}
cancel-in-progress: true

jobs:
windows:
name: Windows VS2022
runs-on: windows-2022

steps:
- name: Checkout CSFML
uses: actions/checkout@v3
with:
path: CSFML

- name: Build x86
shell: pwsh
run: |
cd CSFML/tools/nuget
./build.win.ps1 "win-x86"
- name: Build x64
shell: pwsh
run: |
cd CSFML/tools/nuget
./build.win.ps1 "win-x64"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: CSFML-Windows
path: CSFML/tools/nuget/CSFML

linux:
name: Linux
runs-on: ubuntu-22.04

steps:
- name: Checkout CSFML
uses: actions/checkout@v3
with:
path: CSFML

- name: Build
shell: bash
run: |
cd CSFML/tools/nuget
./build.docker.sh "linux-x64"
- name: Build
shell: bash
run: |
cd CSFML/tools/nuget
./build.docker.sh "linux-musl-x64"
- name: Build
shell: bash
run: |
cd CSFML/tools/nuget
./build.docker.sh "linux-arm"
- name: Build
shell: bash
run: |
cd CSFML/tools/nuget
./build.docker.sh "linux-arm64"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: CSFML-Linux
path: CSFML/tools/nuget/CSFML
27 changes: 24 additions & 3 deletions tools/nuget/build.docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ set -e

if [[ -z "$1" ]]; then
echo 'No Runtime Identifier specified, running all known RIDs'
./build.docker.sh "alpine-x64"
./build.docker.sh "debian-x64"
./build.docker.sh "fedora-x64"
./build.docker.sh "linux-x64"
./build.docker.sh "linux-musl-x64"
./build.docker.sh "linux-arm"
./build.docker.sh "linux-arm64"
exit 0
fi

Expand All @@ -30,6 +31,26 @@ case "$RID" in
Shell='/bin/bash'
;;

'linux-x64')
Image='ubuntu:22.04'
Shell='/bin/bash'
;;

'linux-musl-x64')
Image='alpine:3.15'
Shell='/bin/sh'
;;

'linux-arm')
Image='arm32v7/ubuntu:22.04'
Shell='/bin/bash'
;;

'linux-arm64')
Image='arm64v8/ubuntu:22.04'
Shell='/bin/bash'
;;

*)
echo "Unknown Runtime Identifier $RID"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion tools/nuget/build.linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ echo "Please note that all SFML dependencies must be installed and available to

RID="$1"

SFMLBranch="2.5.1" # The branch or tag of the SFML repository to be cloned
SFMLBranch="2.6.1" # The branch or tag of the SFML repository to be cloned
CSFMLDir="$(realpath "$(git rev-parse --show-toplevel)")" # The directory of the source code of CSFML

OutDir="./CSFML/runtimes/$RID/native" # The base directory of all CSFML modules, used to copy the final libraries
Expand Down
4 changes: 2 additions & 2 deletions tools/nuget/build.win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (-not $RID) {
exit
}

$Generator = 'Visual Studio 16 2019'
$Generator = 'Visual Studio 17 2022'

switch ($RID) {
'win-x86' {
Expand All @@ -35,7 +35,7 @@ Write-Output "Building $RID"
Write-Output "Using $Generator as the cmake generator"
Write-Output "Using architecture $Architecture"

$SFMLBranch = "2.5.1" # The branch or tag of the SFML repository to be cloned
$SFMLBranch = "2.6.1" # The branch or tag of the SFML repository to be cloned
$CSFMLDir = (Get-Item (git rev-parse --show-toplevel)).FullName # The directory of the source code of CSFML

$OutDir = "./CSFML/runtimes/$RID/native" # The directory of all CSFML modules, used to copy the final dlls
Expand Down

0 comments on commit 1d77fd9

Please sign in to comment.