Skip to content
Draft
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
65 changes: 65 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build DuckGameRebuilt
description: Build DuckGameRebuilt

runs:
using: "composite"

steps:
- name: Install MSBuild
shell: bash
run: |
echo "::group::== Install MSBuild =="
sudo apt-get update
sudo apt-get install -y msbuild zip
echo "::endgroup::"

- name: Restore NuGet packages
shell: bash
run: |
echo "::group::== Restore NuGet packages =="
nuget restore .
echo "::endgroup::"


- name: Add Project Dependencies [#1]
shell: bash
run: |
mkdir ./bin
cp ./DuckGame/lib/* ./bin

- name: Build with AutoUpdater
shell: bash
run: |
echo "::group::== Build with AutoUpdater =="
msbuild /m /p:Configuration=ReleaseAutoUpdater .
echo "::endgroup::"

- name: Zip binaries
shell: bash
run: |
echo "::group::== Zip binaries =="
mv ./bin ./DuckGameRebuilt
cd ./DuckGameRebuilt && zip -r ../DuckGameRebuilt.zip ./* && cd ..
echo "::endgroup::"

- name: Add Project Dependencies [#2]
shell: bash
run: |
mkdir ./bin
cp ./DuckGame/lib/* ./bin

- name: Build without AutoUpdater
shell: bash
run: |
echo "::group::== Build without AutoUpdater =="
msbuild /m /p:Configuration=Release .
echo "::endgroup::"

- name: Reorganize files for DGR mod
shell: bash
run: |
mv ./bin ./Rebuilder/dgr
find ./Rebuilder -maxdepth 1 ! \( -name "mod.conf" -o -name "Rebuilder.dll" \) -type f -exec rm {} +
rm -r ./Rebuilder/build
mkdir ./steammod
mv ./Rebuilder ./steammod/Rebuilder
71 changes: 0 additions & 71 deletions .github/workflows/autobuild_for_release.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
workflow_dispatch:
inputs:
upload-artifact:
description: Upload compiled artifact
type: boolean
default: false

workflow_call:
inputs:
upload-artifact:
type: boolean
default: true
outputs:
artifact-name:
value: DuckGameRebuilt

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 1

- uses: ./.github/actions/build

- name: Upload compiled artifact
if: ${{ inputs.upload-artifact }}
uses: actions/upload-artifact@v7
with:
name: DuckGameRebuilt
path: DuckGameRebuilt.zip
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
release:
types: [published]

jobs:
build_and_release:
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 1

- uses: ./.github/actions/build

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: DuckGameRebuilt.zip
overwrite: true

- name: Update DGR mod
uses: AnarkisGaming/workshop@v1
with:
appID: 312530
publishedFileID: ${{ vars.WORKSHOP_ID }}
path: ./steammod
changelog: ${{ github.event.release.body }}
env:
STEAM_ACCOUNT_NAME: "DuckGameRebuilt"
STEAM_PASSWORD: ${{ secrets.STEAM_PASS }}