🏗️ Build mod #9
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: Build mod | |
on: | |
pull_request: | |
branches: "*" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
PROJECT_NAME: jcdcdev.Eco.Signs | |
PROJECT_PATH: ./src/jcdcdev.Eco.Signs.csproj | |
BUILD_OUTPUT: ./build-output | |
MOD_OUTPUT: ./build-assets/Mods/jcdcdev.Eco.Signs | |
ASSET_NAME: jcdcdev.Eco.Signs-dev-${{ github.sha }} | |
ARTIFACT_OUTPUT: ./build-assets | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Download, Extract, and Copy DLLs | |
run: | | |
mkdir ./src/lib | |
wget -O file.zip https://api.mod.io/v1/games/6/mods/2595901/files/3605377/download | |
unzip -d extracted_files file.zip | |
find extracted_files -name "*.dll" -exec cp {} ./src/lib/ \; | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 7.0.x | |
- name: Build project | |
run: dotnet build ${{ env.PROJECT_PATH }} -o ${{ env.MOD_OUTPUT }} --configuration Release | |
- uses: vimtor/action-zip@v1 | |
with: | |
files: ${{ env.ARTIFACT_OUTPUT }} | |
dest: ${{ env.ASSET_NAME }}.zip | |
- name: Upload package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.ASSET_NAME }} | |
path: ${{ env.ASSET_NAME }}.zip |