Properly Create Tags for Edge Builds #176
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: Windows Build | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- 'master' | |
- '1.0' | |
- '1.1' | |
jobs: | |
job: | |
name: ${{ matrix.os }}-${{ matrix.buildtype }} | |
runs-on: ${{ matrix.os }} | |
permissions: | |
packages: write | |
contents: write | |
strategy: | |
matrix: | |
os: [windows-2022] | |
buildtype: [windows-release, windows-release-asan, windows-debug] | |
include: | |
- os: windows-2022 | |
triplet: x64-windows | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
- name: Ensure Correct VCPKG Version | |
uses: lukka/run-vcpkg@main | |
with: | |
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git" | |
vcpkgGitCommitId: ${{ steps.vcpkg-step.outputs.vcpkgGitCommitId }} | |
- name: Setup Premake & Generate Solution | |
run: | | |
git clone https://github.com/premake/premake-core | |
cd premake-core | |
cmd /c Bootstrap.bat | |
move .\bin\release\premake5.exe D:\a\BlackTek-Server\BlackTek-Server\premake5.exe | |
cd D:\a\BlackTek-Server\BlackTek-Server | |
D:\a\BlackTek-Server\BlackTek-Server\premake5.exe vs2022 | |
- name: Configure Package Manager | |
uses: egor-tensin/vs-shell@v2 | |
with: | |
arch: x64 | |
- name: Install Dependencies | |
run: | | |
cd D:\a\BlackTek-Server | |
vcpkg install --triplet x64-windows | |
vcpkg integrate install | |
- name: Compile Release | |
run: | | |
cd D:\a\BlackTek-Server\BlackTek-Server | |
msbuild Black-Tek-Server.sln /p:Configuration=Release | |
cmd /c copy Black-Tek-Server.exe BlackTek-Server-Release.exe | |
- name: Compile Debug | |
run: | | |
cd D:\a\BlackTek-Server\BlackTek-Server | |
msbuild Black-Tek-Server.sln /p:Configuration=Debug | |
cmd copy Black-Tek-Server.exe BlackTek-Server-Debug.exe | |
del Black-Tek-Server.exe | |
cd D:\a\BlackTek-Server | |
- name: Upload Artifact | |
id: upload_artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Windows-Artifact-${{ github.sha }} | |
path: | | |
~/BlackTek-Server/BlackTek-Server | |
!~/BlackTek-Server/BlackTek-Server/vcpkg_installed | |
!~/BlackTek-Server/BlackTek-Server/build | |
- name: Create Tag for Release | |
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git tag Windows-Edge-Build-${{ github.sha }} | |
git push origin Windows-Edge-Build-${{ github.sha }} | |
- name: Create Edge Build | |
id: create_release | |
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) | |
uses: elgohr/Github-Release-Action@v5 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
title: BlackTek-Server-WindowsEdgeBuild-${{ github.sha }} | |
tag: Windows-Edge-Build-${{ github.sha }} | |
prerelease: true | |
- name: Upload Assets for Edge Build | |
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ steps.upload_artifact.outputs.artifact_archive }} | |
asset_name: BlackTek-Server.zip |