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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/actions/project-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ inputs:
project_path:
description: 'Path to project folder'
required: true
target_framework:
description: 'The target framework to build on'
required: true
runtime_version:
description: 'Build runtime version default linux-x64'
required: false
default: 'linux-x64'
nuget_push:
description: 'Push to Nuget on release?'
required: false
Expand Down Expand Up @@ -44,9 +51,9 @@ runs:
- name: Common commands
id: common-commands
run: |
echo "dotnet-restore=dotnet restore \$PROJECT_PATH" >> $GITHUB_OUTPUT
echo "dotnet-build=dotnet build \$PROJECT_PATH --configuration Release --no-restore -p:Version=${{ steps.get-version.outputs.version }} -p:PackageVersion=${{ steps.get-version.outputs.version }} -p:InformationalVersion=${{ steps.get-version.outputs.version }}" >> $GITHUB_OUTPUT
echo "dotnet-test=dotnet test \$PROJECT_PATH --configuration Release --no-restore --no-build" >> $GITHUB_OUTPUT
echo "dotnet-restore=dotnet restore \$PROJECT_PATH --runtime ${{ inputs.runtime_version }} -p:Configuration=Release -p:TargetFramework=${{ inputs.target_framework }}" >> $GITHUB_OUTPUT
echo "dotnet-build=dotnet build \$PROJECT_PATH --configuration Release --no-restore --runtime ${{ inputs.runtime_version }} -p:TargetFramework=${{ inputs.target_framework }} -p:RocketModFixVersion=${{ steps.get-version.outputs.version }}" >> $GITHUB_OUTPUT
echo "dotnet-test=dotnet test \$PROJECT_PATH --configuration Release --no-restore --no-build --runtime ${{ inputs.runtime_version }} -p:TargetFramework=${{ inputs.target_framework }}" >> $GITHUB_OUTPUT
shell: bash

# Install dependencies (this needs to be a separate step from build for caching)
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/RocketModFix.Build.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
name: RocketModFix.Release
name: RocketModFix.Module

on:
create:
tags:
- "*"
push:
branches: [ master ]
paths:
- '.github/workflows/RocketModFix.Module.yaml'
- 'Rocket/**'
- 'Rocket.Unturned/**'
pull_request:
paths:
- '.github/workflows/RocketModFix.Module.yaml'
- 'Rocket/**'
- 'Rocket.Unturned/**'

jobs:
Build:
if: github.event_name == 'create' && github.event.ref_type == 'tag'
runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- name: Checkout code
Expand All @@ -19,36 +29,36 @@ jobs:
with:
dotnet-version: 8.x

- name: Build
run: dotnet build ./Rocket.Unturned/Rocket.Unturned.csproj /p:RocketModVersion=${{ github.ref_name }} /p:CreateRocketModUnturnedModuleArtifacts=true -c Release -f net461

- name: Upload build
uses: actions/upload-artifact@v4
- name: Build Project
uses: ./.github/actions/project-build
id: project-build
with:
name: build
path: "./Rocket.Unturned/Rocket.Unturned.Module.zip"
if-no-files-found: error
project_path: Rocket.Unturned/Rocket.Unturned.csproj
nuget_push: false
target_framework: net461
github_token: ${{ secrets.PAT }}

Release:
needs: [Build]
runs-on: ubuntu-latest
- name: Install zip
run: sudo apt-get install zip

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Zip artifacts
run: "cd ./Rocket.Unturned/bin/Release/net461/linux-x64/Rocket.Unturned && zip -qq -r ./Rocket.Unturned.Module.zip *"

- name: Download build
uses: actions/download-artifact@v4
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: build
path: ./build/
name: Rocket.Unturned.Module.zip
path: "./Rocket.Unturned/bin/Release/net461/linux-x64/Rocket.Unturned/Rocket.Unturned.Module.zip"
if-no-files-found: error

- name: Create version
if: github.event_name == 'create' && github.event.ref_type == 'tag'
id: get-version
run: echo "version=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
shell: bash

- name: Check Prerelease
if: github.event_name == 'create' && github.event.ref_type == 'tag'
id: check-prerelease
run: "if ${{ contains(steps.get-version.outputs.version, '-') }}; then
echo is_prerelease=true >> $GITHUB_OUTPUT;
Expand All @@ -58,11 +68,12 @@ jobs:
shell: bash

- name: Create Release
if: github.event_name == 'create' && github.event.ref_type == 'tag'
uses: ncipollo/release-action@v1.14.0
with:
name: RocketModFix Release v${{ steps.get-version.outputs.version }}
tag: v${{ steps.get-version.outputs.version }}
artifacts: "./build/Rocket.Unturned.Module.zip"
artifacts: "./Rocket.Unturned/bin/Release/net461/linux-x64/Rocket.Unturned/Rocket.Unturned.Module.zip"
token: ${{ secrets.PAT }}
prerelease: ${{ steps.check-prerelease.outputs.is_prerelease }}
allowUpdates: true
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/RocketModFix.PullRequest.Artifacts.yaml

This file was deleted.

9 changes: 1 addition & 8 deletions Rocket.Unturned/Rocket.Unturned.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</PackageReference>
</ItemGroup>

<Target Name="RocketModModuleArtifacts" AfterTargets="PostBuildEvent" Condition=" '$(CreateRocketModUnturnedModuleArtifacts)' == 'true' ">
<Target Name="RocketModModuleArtifacts" AfterTargets="PostBuildEvent">

<ItemGroup>
<RocketModFiles Include="$(OutDir)*Rocket*.dll"/>
Expand All @@ -39,13 +39,6 @@
<Copy SourceFiles="@(RocketModModuleFiles)" DestinationFolder="$(RocketUnturnedOutputDirectory)"/>
<Copy SourceFiles="@(RocketModInstallationGuides)" DestinationFolder="$(RocketUnturnedOutputDirectory)\.."/>

<Delete Files="Rocket.Unturned.Module.zip"/>

<ZipDirectory
SourceDirectory="$(RocketUnturnedOutputDirectory)\.."
DestinationFile="Rocket.Unturned.Module.zip"
Overwrite="true"/>

</Target>

</Project>
1 change: 0 additions & 1 deletion props/SharedProjectProps.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<Prefer32Bit>false</Prefer32Bit>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);NU1701;NU1702;CS0436;CS1591</NoWarn>
<CreateRocketModUnturnedModuleArtifacts>true</CreateRocketModUnturnedModuleArtifacts>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>Unturned RocketMod RocketModFix OpenMod Utility Lib Module Rocket Helper</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down