Skip to content

Release

Release #106

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: '1.0.0.0'
version_postifx:
description: 'Version Postfix'
required: true
default: '-preview'
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./intermediate/vs2022/ds3os.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
# Version number being build.
VERSION_NUMBER_POSTFIX: ${{ github.event.inputs.version_postifx }}
# Version number being build.
VERSION_NUMBER: ${{ github.event.inputs.version }}
jobs:
build-windows:
name: Build Windows
runs-on: windows-2022
steps:
- name: Checkout respository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Generate Solution
shell: cmd
working-directory: ${{github.workspace}}/Tools
run: ${{github.workspace}}/Tools/generate_vs2022.bat
- name: Restore Dependencies
working-directory: ${{github.workspace}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /t:Restore
- name: Package DotNet
run: dotnet publish ./Source/Loader/Loader.csproj -r win-x64 -c Release --output ${{github.workspace}}/Bin/Loader/Package/ /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:Version=${{env.VERSION_NUMBER}}${{env.VERSION_NUMBER_POSTFIX}} /p:FileVersion=${{env.VERSION_NUMBER}} /p:AssemblyVersion=${{env.VERSION_NUMBER}}
- name: Build
working-directory: ${{github.workspace}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /t:Build
- name: Package Release
shell: cmd
working-directory: ${{github.workspace}}
run: ${{github.workspace}}/Tools/generate_package_windows.bat
- name: Zip Release
uses: vimtor/action-zip@v1
with:
files: DS3OS/
dest: windows.zip
- name: Upload Artifact
id: upload-artifact
uses: actions/upload-artifact@master
with:
path: ./windows.zip
name: windows
build-linux:
name: Build Linux
runs-on: ubuntu-20.04
steps:
- name: Checkout respository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Generate Solution
shell: bash
working-directory: ${{github.workspace}}/Tools
run: ${{github.workspace}}/Tools/generate_make_release.sh
- name: Build
working-directory: ${{github.workspace}}/intermediate/make
run: make
- name: Package Release
shell: bash
working-directory: ${{github.workspace}}
run: ${{github.workspace}}/Tools/generate_package_linux.sh
- name: Zip Release
uses: vimtor/action-zip@v1
with:
files: DS3OS/
dest: linux.zip
- name: Upload Artifact
id: upload-artifact
uses: actions/upload-artifact@master
with:
path: ./linux.zip
name: linux
build-docker:
name: Build Docker
runs-on: ubuntu-20.04
steps:
- name: Checkout respository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Generate Solution
shell: bash
working-directory: ${{github.workspace}}/Tools
run: ${{github.workspace}}/Tools/generate_make_release.sh
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push master-server docker
uses: docker/build-push-action@v2
with:
context: ./Source/MasterServer/
file: ./Source/MasterServer/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ds3os-master:latest
- name: Build and push server docker
uses: docker/build-push-action@v2
with:
context: .
file: ./DarkSouls3.Dockerfile
push: true
no-cache: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ds3os:latest
- name: Build and push server docker
uses: docker/build-push-action@v2
with:
context: .
file: ./DarkSouls2.Dockerfile
push: true
no-cache: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ds2os:latest
make-release:
name: Make Release
needs: [ build-windows, build-linux, build-docker ]
runs-on: ubuntu-20.04
steps:
- name: Download windows artifact
id: download-windows-artifact
uses: actions/download-artifact@master
with:
name: windows
- name: Download linux artifact
id: download-linux-artifact
uses: actions/download-artifact@master
with:
name: linux
- name: Display artifacts
run: ls -R
- name: Make Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{env.VERSION_NUMBER}}${{env.VERSION_NUMBER_POSTFIX}}
release_name: Release v${{env.VERSION_NUMBER}}${{env.VERSION_NUMBER_POSTFIX}}
body: Preview build, not officially supported yet.
draft: false
prerelease: true
- name: Upload Windows Release Asset
id: upload-windows-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows.zip
asset_name: windows.zip
asset_content_type: application/zip
- name: Upload Linux Release Asset
id: upload-linux-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux.zip
asset_name: linux.zip
asset_content_type: application/zip