diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index d11edab..0000000 --- a/.drone.yml +++ /dev/null @@ -1,41 +0,0 @@ -kind: pipeline -type: docker -name: build - -platform: - os: windows - arch: amd64 - -trigger: - branch: - - main - -clone: - disable: true - -steps: - - name: clone - image: refringe/spt-build-environment:1.0.0 - commands: - - git clone https://dev.sp-tarkov.com/SPT-AKI/Build.git C:\Code - - cd C:\Code - - git checkout ${DRONE_COMMIT} - volumes: - - name: code - path: C:\Code - - - name: build - image: refringe/spt-build-environment:1.0.0 - environment: - MODULE_DOMAIN: - from_secret: MODULE_DOMAIN - commands: - - cd C:\Code - - pwsh -File C:\Code\project\build.ps1 -Tag "${DRONE_TAG}" - volumes: - - name: code - path: C:\Code - -volumes: - - name: code - temp: {} diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 1690cee..0d24c37 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -40,7 +40,7 @@ jobs: if: needs.check-tag-exists.outputs.proceed == 'true' runs-on: ubuntu-latest container: - image: refringe/spt-build-server:0.0.3 + image: refringe/spt-build-server:0.0.4 steps: - name: Clone run: | @@ -105,13 +105,13 @@ jobs: build- - name: Install Dependencies - #if: steps.build-cache.outputs.cache-hit != 'true' + if: steps.build-cache.outputs.cache-hit != 'true' run: | cd /workspace/refringe/Build/server/project npm install - name: Build Server - #if: steps.build-cache.outputs.cache-hit != 'true' + if: steps.build-cache.outputs.cache-hit != 'true' run: | cd /workspace/refringe/Build/server/project BUILD_TYPE="${{ steps.build-type.outputs.build_type }}" @@ -238,3 +238,41 @@ jobs: name: launcher-build path: /workspace/refringe/Build/launcher/project/Build overwrite: true + + extract-and-combine: + needs: [build-server, build-modules, build-launcher] + runs-on: ubuntu-latest + container: + image: refringe/spt-build-server:0.0.4 + steps: + - name: Create combined build directory + run: mkdir -p /workspace/refringe/Build/combined-build + + - name: Download Server Build Archive + uses: actions/download-artifact@v3 + with: + name: server-build + path: /workspace/refringe/Build/combined-build/ + + - name: Download Modules Build Archive + uses: actions/download-artifact@v3 + with: + name: modules-build + path: /workspace/refringe/Build/combined-build/ + + - name: Download Launcher Build Archive + uses: actions/download-artifact@v3 + with: + name: launcher-build + path: /workspace/refringe/Build/combined-build/ + + - name: Extract Archives + run: | + cd /workspace/refringe/Build/combined-build + for archive in *.zip; do + echo "Extracting $archive..." + 7z x "$archive" -aoa + rm "$archive" + done + tree /workspace/refringe/Build/combined-build + shell: bash diff --git a/LICENSE b/LICENSE index 32d0efa..58b4830 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Tyler Brownell +Copyright (c) 2024 Refringe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index e3575e9..db3d9b5 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ # SPT Build Project - CI/CD Process -This document outlines the Continuous Integration and Continuous Deployment (CI/CD) setup for the `SPT-AKI/Build` project, which automates the build and release process for three interconnected repositories: `SPT-AKI/Modules`, `SPT-AKI/Server`, and `SPT-AKI/Launcher`. The process is orchestrated using Drone CI with Gitea and relies on a Windows Docker runner to execute PowerShell scripts for building and packaging the projects. +This document outlines the Continuous Integration and Continuous Deployment (CI/CD) setup for the `SPT-AKI/Build` project, which automates the build and release process for three interconnected repositories: `SPT-AKI/Modules`, `SPT-AKI/Server`, and `SPT-AKI/Launcher`. The process is orchestrated using Gitea Actions. ## Project Repositories +TODO: Update for Gitea + Each of the three project repositories (`SPT-AKI/Modules`, `SPT-AKI/Server`, `SPT-AKI/Launcher`) requires a `.drone.yml` file configured to trigger a build in this `SPT-AKI/Build` repository using the Drone downstream plugin upon a new tag push (e.g., `v3.8.0`). The contents of the `.drone.yml` file can be found in `project-trigger.yml`. Note that the file must be present and named `.drone.yml` to trigger the build process. ### Build Process -This repository's `.drone.yml` initiates the CI/CD process by running a PowerShell script `build.ps1` on a Windows Docker runner. The PowerShell script performs the following actions: +This repository initiates the CI/CD build process by performing the following actions: 1. Checks if the passed in tag exists in all three project repositories. 1. Clones the tagged commits of each repository. @@ -17,53 +19,13 @@ This repository's `.drone.yml` initiates the CI/CD process by running a PowerShe 1. Copies the release file to a web-accessible location. 1. Release notifications (creates a Gitea release, sends a Discord notification, etc.) -## Drone Runner Configuration +## Gitea Runner Configuration -Drone CI Runner Requirements: -- Windows Server 2022 Host -- Docker Community Edition (CE) - -### Install Docker CE - -Docker CE needs to be installed (not Docker Desktop). The following steps outline the installation process for Windows Server 2022: - -To install Docker CE on Windows Server 2022, follow these steps: - -1. Open `Windows Server Manager` -1. Select `Manage` -1. Select `Add Roles and Features` -1. Click `Next` on the `Before You Begin` page -1. Select `Role-based or feature-based installation` -1. Select the name of the server where the feature will be installed and click `Next` -1. Select `Hyper-V` and click `Next` -1. Select `Containers` and click `Next` -1. Click `Install` on the `Confirm installation selections` page -1. Click `Close` on the `Installation progress` page -1. Open a PowerShell terminal (as admin) and run the following commands to install Docker CE: - -```powershell -# Download install script -Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1 - -# Run install script -.\install-docker-ce.ps1 - -# Test Docker installation -Get-Service Docker -``` +TODO: Update for Gitea ### Run the Runner -Use the command below to start the Drone CI Runner. But first... - - Replace the `DRONE_RPC_HOST` value with the host of the Drone server that should be connected to for builds. - - Replace the `DRONE_RPC_SECRET` value with the Drone server secret. - - Replace the `DRONE_RUNNER_NAME` value with a unique name for the runner. - - Replace the `DRONE_UI_PASSWORD` value with a password to access the web runner UI. - - Adjust `DRONE_RUNNER_CAPACITY` to the number of builds that should be allowed to run at once. - -```powershell -docker run --detach --volume=//./pipe/docker_engine://./pipe/docker_engine --env=DRONE_RPC_PROTO=https --env=DRONE_RPC_HOST=example.com --env=DRONE_RPC_SECRET=secret --env=DRONE_RUNNER_CAPACITY=2 --env=DRONE_RUNNER_NAME=example --env=DRONE_UI_DISABLE=false --env=DRONE_UI_USERNAME=root --env=DRONE_UI_PASSWORD=password --publish=3000:3000 --restart=always --name=runner drone/drone-runner-docker:latest -``` +TODO: Update for Gitea ## Module Requirements diff --git a/project-trigger.yml b/project-trigger.yml index a23581b..0284fc1 100644 --- a/project-trigger.yml +++ b/project-trigger.yml @@ -1,19 +1 @@ -kind: pipeline -type: docker -name: trigger-spt-build - -trigger: - event: - - tag - -steps: -- name: trigger-build-check - image: plugins/downstream - settings: - repositories: - - SPT-AKI/Build - server: https://drone.sp-tarkov.com - token: - from_secret: gitea_token - when: - event: tag +# TODO: Gitea Version diff --git a/project/static/BepInEx.Config/BepInEx/config/BepInEx.cfg b/project/static/BepInEx/config/BepInEx.cfg similarity index 99% rename from project/static/BepInEx.Config/BepInEx/config/BepInEx.cfg rename to project/static/BepInEx/config/BepInEx.cfg index 3af1031..388f654 100644 --- a/project/static/BepInEx.Config/BepInEx/config/BepInEx.cfg +++ b/project/static/BepInEx/config/BepInEx.cfg @@ -148,3 +148,4 @@ Type = Application # Setting type: String # Default value: .cctor Method = .cctor + diff --git a/project/static/BepInEx.ConfigurationManager.Config/BepInEx/config/com.bepis.bepinex.configurationmanager.cfg b/project/static/BepInEx/config/com.bepis.bepinex.configurationmanager.cfg similarity index 99% rename from project/static/BepInEx.ConfigurationManager.Config/BepInEx/config/com.bepis.bepinex.configurationmanager.cfg rename to project/static/BepInEx/config/com.bepis.bepinex.configurationmanager.cfg index 5de3f75..d43a396 100644 --- a/project/static/BepInEx.ConfigurationManager.Config/BepInEx/config/com.bepis.bepinex.configurationmanager.cfg +++ b/project/static/BepInEx/config/com.bepis.bepinex.configurationmanager.cfg @@ -36,3 +36,4 @@ Hide single sections = false # Setting type: Boolean # Default value: true Plugin collapsed default = true + diff --git a/project/static/BepInEx/core/0Harmony.dll b/project/static/BepInEx/core/0Harmony.dll new file mode 100644 index 0000000..99daef7 Binary files /dev/null and b/project/static/BepInEx/core/0Harmony.dll differ diff --git a/project/static/BepInEx_x64_5.4.22.0/BepInEx/core/0Harmony.xml b/project/static/BepInEx/core/0Harmony.xml similarity index 100% rename from project/static/BepInEx_x64_5.4.22.0/BepInEx/core/0Harmony.xml rename to project/static/BepInEx/core/0Harmony.xml diff --git a/project/static/BepInEx/core/0Harmony20.dll b/project/static/BepInEx/core/0Harmony20.dll new file mode 100644 index 0000000..7cc2c1d Binary files /dev/null and b/project/static/BepInEx/core/0Harmony20.dll differ diff --git a/project/static/BepInEx/core/BepInEx.Harmony.dll b/project/static/BepInEx/core/BepInEx.Harmony.dll new file mode 100644 index 0000000..03565da Binary files /dev/null and b/project/static/BepInEx/core/BepInEx.Harmony.dll differ diff --git a/project/static/BepInEx_x64_5.4.22.0/BepInEx/core/BepInEx.Harmony.xml b/project/static/BepInEx/core/BepInEx.Harmony.xml similarity index 100% rename from project/static/BepInEx_x64_5.4.22.0/BepInEx/core/BepInEx.Harmony.xml rename to project/static/BepInEx/core/BepInEx.Harmony.xml diff --git a/project/static/BepInEx/core/BepInEx.Preloader.dll b/project/static/BepInEx/core/BepInEx.Preloader.dll new file mode 100644 index 0000000..a988a68 Binary files /dev/null and b/project/static/BepInEx/core/BepInEx.Preloader.dll differ diff --git a/project/static/BepInEx_x64_5.4.22.0/BepInEx/core/BepInEx.Preloader.xml b/project/static/BepInEx/core/BepInEx.Preloader.xml similarity index 100% rename from project/static/BepInEx_x64_5.4.22.0/BepInEx/core/BepInEx.Preloader.xml rename to project/static/BepInEx/core/BepInEx.Preloader.xml diff --git a/project/static/BepInEx/core/BepInEx.dll b/project/static/BepInEx/core/BepInEx.dll new file mode 100644 index 0000000..826b479 Binary files /dev/null and b/project/static/BepInEx/core/BepInEx.dll differ diff --git a/project/static/BepInEx_x64_5.4.22.0/BepInEx/core/BepInEx.xml b/project/static/BepInEx/core/BepInEx.xml similarity index 100% rename from project/static/BepInEx_x64_5.4.22.0/BepInEx/core/BepInEx.xml rename to project/static/BepInEx/core/BepInEx.xml diff --git a/project/static/BepInEx/core/HarmonyXInterop.dll b/project/static/BepInEx/core/HarmonyXInterop.dll new file mode 100644 index 0000000..241602f Binary files /dev/null and b/project/static/BepInEx/core/HarmonyXInterop.dll differ diff --git a/project/static/BepInEx/core/Mono.Cecil.Mdb.dll b/project/static/BepInEx/core/Mono.Cecil.Mdb.dll new file mode 100644 index 0000000..bddf5cb Binary files /dev/null and b/project/static/BepInEx/core/Mono.Cecil.Mdb.dll differ diff --git a/project/static/BepInEx/core/Mono.Cecil.Pdb.dll b/project/static/BepInEx/core/Mono.Cecil.Pdb.dll new file mode 100644 index 0000000..9227f6d Binary files /dev/null and b/project/static/BepInEx/core/Mono.Cecil.Pdb.dll differ diff --git a/project/static/BepInEx/core/Mono.Cecil.Rocks.dll b/project/static/BepInEx/core/Mono.Cecil.Rocks.dll new file mode 100644 index 0000000..a77ac87 Binary files /dev/null and b/project/static/BepInEx/core/Mono.Cecil.Rocks.dll differ diff --git a/project/static/BepInEx/core/Mono.Cecil.dll b/project/static/BepInEx/core/Mono.Cecil.dll new file mode 100644 index 0000000..18735f9 Binary files /dev/null and b/project/static/BepInEx/core/Mono.Cecil.dll differ diff --git a/project/static/BepInEx/core/MonoMod.RuntimeDetour.dll b/project/static/BepInEx/core/MonoMod.RuntimeDetour.dll new file mode 100644 index 0000000..5709bbb Binary files /dev/null and b/project/static/BepInEx/core/MonoMod.RuntimeDetour.dll differ diff --git a/project/static/BepInEx_x64_5.4.22.0/BepInEx/core/MonoMod.RuntimeDetour.xml b/project/static/BepInEx/core/MonoMod.RuntimeDetour.xml similarity index 100% rename from project/static/BepInEx_x64_5.4.22.0/BepInEx/core/MonoMod.RuntimeDetour.xml rename to project/static/BepInEx/core/MonoMod.RuntimeDetour.xml diff --git a/project/static/BepInEx/core/MonoMod.Utils.dll b/project/static/BepInEx/core/MonoMod.Utils.dll new file mode 100644 index 0000000..1d9fb35 Binary files /dev/null and b/project/static/BepInEx/core/MonoMod.Utils.dll differ diff --git a/project/static/BepInEx_x64_5.4.22.0/BepInEx/core/MonoMod.Utils.xml b/project/static/BepInEx/core/MonoMod.Utils.xml similarity index 100% rename from project/static/BepInEx_x64_5.4.22.0/BepInEx/core/MonoMod.Utils.xml rename to project/static/BepInEx/core/MonoMod.Utils.xml diff --git a/project/static/BepInEx/plugins/spt/ConfigurationManager.dll b/project/static/BepInEx/plugins/spt/ConfigurationManager.dll new file mode 100644 index 0000000..0081f78 Binary files /dev/null and b/project/static/BepInEx/plugins/spt/ConfigurationManager.dll differ diff --git a/project/static/BepInEx.ConfigurationManager_v18.0.1/BepInEx/plugins/spt/ConfigurationManager.xml b/project/static/BepInEx/plugins/spt/ConfigurationManager.xml similarity index 100% rename from project/static/BepInEx.ConfigurationManager_v18.0.1/BepInEx/plugins/spt/ConfigurationManager.xml rename to project/static/BepInEx/plugins/spt/ConfigurationManager.xml diff --git a/project/static/BepInEx.Config/LICENSE-BEPINEX.txt b/project/static/LICENSE-BEPINEX.txt similarity index 100% rename from project/static/BepInEx.Config/LICENSE-BEPINEX.txt rename to project/static/LICENSE-BEPINEX.txt diff --git a/project/static/BepInEx.ConfigurationManager.Config/LICENSE-ConfigurationManager.txt b/project/static/LICENSE-ConfigurationManager.txt similarity index 100% rename from project/static/BepInEx.ConfigurationManager.Config/LICENSE-ConfigurationManager.txt rename to project/static/LICENSE-ConfigurationManager.txt diff --git a/project/static/BepInEx_x64_5.4.22.0/doorstop_config.ini b/project/static/doorstop_config.ini similarity index 100% rename from project/static/BepInEx_x64_5.4.22.0/doorstop_config.ini rename to project/static/doorstop_config.ini diff --git a/project/static/winhttp.dll b/project/static/winhttp.dll new file mode 100644 index 0000000..bdf9c79 Binary files /dev/null and b/project/static/winhttp.dll differ