Skip to content

release

release #54

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
tag:
description: 'Tagged Version'
required: true
permissions:
contents: write
jobs:
windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure Cache
run: |
Add-Content -Path $env:GITHUB_ENV -Value "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL"
Add-Content -Path $env:GITHUB_ENV -Value "ACTIONS_RUNTIME_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN"
- name: Install dependencies
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Configure
run: |
mkdir ${{ github.workspace }}\build && cd ${{ github.workspace }}\build
cmake ${{ github.workspace }} -DAMNESIA_TDD_VERSION:STRING="${{github.event.inputs.tag}}" -DVCPKG_INSTALL_OPTIONS="--binarysource=clear\;x-gha,readwrite" -DCMAKE_BUILD_TYPE:STRING=Release -DAMNESIA_GAME_DIRECTORY:STRING='' -G "Visual Studio 17 2022" -A x64
- name: Build
run: |
cd ${{ github.workspace }}\build
msbuild ALL_BUILD.vcxproj /property:Configuration=Release
- name: Zipping (Windows)
run: |
cd ${{ github.workspace }}/build
7z a Amnesia_windows_x68_64_${{ github.event.inputs.tag }}.zip amnesia/Release
- uses: actions/upload-artifact@master
with:
name: windows-build-artifacts
path: ${{ github.workspace }}/build/*.zip
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure Cache
shell: bash
run: |
echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL" >> "$GITHUB_ENV"
echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN" >> "$GITHUB_ENV"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ninja-build cmake libdevil-dev mesa-common-dev libxmu-dev libxi-dev libgl-dev libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libglu1-mesa-dev libgtk-3-dev libvulkan-dev vulkan-tools glslang-tools
- name: Configure
run: |
mkdir ${{ github.workspace }}/build && cd ${{ github.workspace }}/build
cmake ${{ github.workspace }} -DAMNESIA_TDD_VERSION:STRING="${{github.event.inputs.tag}}" -DVCPKG_INSTALL_OPTIONS="--binarysource=clear\;x-gha,readwrite" -DCMAKE_BUILD_TYPE:STRING=Release -DAMNESIA_GAME_DIRECTORY:STRING='' -G Ninja
- name: Build
run: |
cd ${{ github.workspace }}/build
ninja
- name: Zipping
run: |
cd ${{ github.workspace }}/build
zip -r Amnesia_linux_x68_64_${{ github.event.inputs.tag }}.zip amnesia
- uses: actions/upload-artifact@master
with:
name: linux-build-artifacts
path: ${{ github.workspace }}/build/*.zip
publish:
needs: [windows, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: linux-build-artifacts
path: ${{ github.workspace }}
- uses: actions/download-artifact@v3
with:
name: windows-build-artifacts
path: ${{ github.workspace }}
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.event.inputs.tag }}"
prerelease: true
title: "Release: ${{ github.event.inputs.tag }}"
files: |
${{ github.workspace }}/*.zip