forked from FrictionalGames/AmnesiaTheDarkDescent
-
Notifications
You must be signed in to change notification settings - Fork 4
96 lines (94 loc) · 3.71 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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