security system #457
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Build and Test | |
on: | |
push: | |
branches: | |
- "develop" | |
pull_request: | |
branches: | |
- "*" | |
env: | |
DOTNET_VERSION: '7.0.x' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Format check | |
run: | | |
dotnet format --verify-no-changes | |
- name: Test | |
run: | | |
dotnet test /p:CollectCoverage=true | |
build-windows: | |
name: Build Windows | |
runs-on: windows-latest | |
steps: | |
# Setup | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
# Build | |
- name: Publish | |
run: | | |
dotnet publish --configuration Release --runtime win-x64 --self-contained true --property PublishDir=publish | |
# Upload | |
- name: Upload Build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: StationHub-win-x64 | |
path: D:\a\stationhub\stationhub\UnitystationLauncher\publish\ | |
build-macos: | |
name: Build MacOS | |
runs-on: ubuntu-latest | |
steps: | |
# Setup | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
# Build | |
- name: Publish | |
run: | | |
dotnet publish --configuration Release --runtime osx-x64 -t:BundleApp -p:RuntimeIdentifier=osx-x64 -p:UseAppHost=true --self-contained true --property PublishDir=~/publish \ | |
&& sudo chmod +x ~/publish/StationHub.app/Contents/MacOS/StationHub \ | |
&& cd ~/publish \ | |
&& tar -cvf ~/publish/StationHub.tar StationHub.app | |
# Upload | |
- name: Upload Build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: StationHub-osx-x64 | |
path: ~/publish/StationHub.tar | |
build-linux: | |
name: Build Linux | |
runs-on: ubuntu-latest | |
steps: | |
# Setup | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
# Build | |
- name: Publish | |
run: | | |
dotnet publish --configuration Release --runtime linux-x64 --self-contained true --property PublishDir=~/publish | |
# Upload | |
- name: Upload Build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: StationHub-linux-x64 | |
path: ~/publish | |
build-flatpak: | |
name: Build Linux Flatpak | |
runs-on: ubuntu-latest | |
steps: | |
# Setup | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
# Build | |
- name: Test Flatpak Build | |
run: | | |
dotnet publish --framework net7.0 --runtime linux-x64 --configuration Release --self-contained true /p:DefineConstants="FLATPAK" /p:DisableBeauty=true |