Skip to content

Protocol Hooks Build #83

Protocol Hooks Build

Protocol Hooks Build #83

Workflow file for this run

###
### Copyright (c) 2024 Carbon Community
### All rights reserved
###
name: Protocol Hooks Build
concurrency: build-protocol-hooks
on:
workflow_dispatch:
inputs:
protocol:
description: 'Carbon Protocol'
required: true
default: '2024.MM.DD.0'
type: string
carbon_branch:
description: 'Carbon Branch'
required: true
default: 'develop'
type: choice
options:
- develop
- preview
- production
- rust_beta/staging
- rust_beta/aux01
- rust_beta/aux02
rust_branch:
description: 'Rust Branch'
required: true
default: 'public'
type: choice
options:
- public
- release
- staging
- aux01
- aux02
debug:
description: 'Debug Hooks'
required: true
default: 'true'
type: boolean
release:
description: 'Release Hooks'
required: true
default: 'false'
type: boolean
oxide_hooks_override:
description: 'Oxide Hooks Override'
required: false
default: ''
type: string
env:
FTP_PWD: ${{ secrets.FTP_PWD }}
DISCORD_HOOK_WH: ${{ secrets.DISCORD_HOOK_WH }}
PROTOCOL: ${{ inputs.protocol }}
RUST_BRANCH: ${{ inputs.rust_branch }}
DEBUG_BUILD: ${{ inputs.debug }}
RELEASE_BUILD: ${{ inputs.release }}
OXIDE_HOOKS_OVERRIDE: ${{ inputs.oxide_hooks_override }}
ACTION_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
jobs:
bootstrap:
name: 🥾 Bootstrap
runs-on: ubuntu-latest
steps:
- name: 🔗 Checkout source code from github
uses: actions/checkout@v3
build-windows:
name: 💻 Windows
needs: bootstrap
runs-on: windows-latest
continue-on-error: false
steps:
- name: 🔗 Checkout source code from github
uses: actions/checkout@v3
with:
ref: ${{ inputs.carbon_branch }}
token: ${{ secrets.PAT_ALL_REPO }}
submodules: recursive
- name: 🛤️ Setup the dotnet build environment
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: 🔨 Built Carbon Hooks on Windows
shell: cmd
run: |
set OXIDE_HOOKS=https://carbonmod.gg/redist/oxide/%RUST_BRANCH%.opj
if NOT "%OXIDE_HOOKS_OVERRIDE%" EQU "" (
set OXIDE_HOOKS=%OXIDE_HOOKS_OVERRIDE%
)
set ROOT=%GITHUB_WORKSPACE%\Carbon.Core\Carbon.Hooks\Carbon.Hooks.Internal\Buildroot\Scripts
call %GITHUB_WORKSPACE%\Tools\Build\win\bootstrap.bat
if %DEBUG_BUILD% EQU true (
cd %ROOT%
echo Debug build is enabled.
call build.bat Debug %RUST_BRANCH% %PROTOCOL% %OXIDE_HOOKS%
) else (
echo Debug build is disabled.
)
if %RELEASE_BUILD% EQU true (
cd %ROOT%
echo Release build is enabled.
call build.bat Release %RUST_BRANCH% %PROTOCOL% %OXIDE_HOOKS%
) else (
echo Release build is disabled.
)
cd %ROOT%
call discord.bat %RUST_BRANCH% %PROTOCOL%
- name: ⬆️ Artifacts - Upload
uses: actions/upload-artifact@v3
with:
name: FTP Output
path: |
Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/*
- name: ⬆️ FTP - Upload Debug (Carbon.Hooks.Community)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.debug }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/debug/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
dest: "server/debug/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
- name: ⬆️ FTP - Upload DebugUnix (Carbon.Hooks.Community)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.debug }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/debugunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
dest: "server/debugunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
- name: ⬆️ FTP - Upload Debug (Carbon.Hooks.Oxide)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.debug }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/debug/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
dest: "server/debug/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
- name: ⬆️ FTP - Upload DebugUnix (Carbon.Hooks.Oxide)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.debug }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/debugunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
dest: "server/debugunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
- name: ⬆️ FTP - Upload Release (Carbon.Hooks.Community)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.release }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/release/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
dest: "server/release/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
- name: ⬆️ FTP - Upload ReleaseUnix (Carbon.Hooks.Community)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.release }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/releaseunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
dest: "server/releaseunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
- name: ⬆️ FTP - Upload Release (Carbon.Hooks.Oxide)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.release }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/release/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
dest: "server/release/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
- name: ⬆️ FTP - Upload ReleaseUnix (Carbon.Hooks.Oxide)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.release }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/releaseunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
dest: "server/releaseunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"