-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# | ||
# Windows build action for ebfd-patches. | ||
# | ||
# Authors: CCHyper, OmniBlade | ||
# | ||
|
||
name: Windows | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
create_release: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Delete Previous Release | ||
uses: dev-drprasad/delete-tag-and-release@v0.2.0 | ||
with: | ||
delete_release: true | ||
tag_name: latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build: | ||
name: Build | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Clone Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get Branch Name | ||
id: branch-name | ||
uses: tj-actions/branch-names@v5.2 | ||
|
||
- name: Set Variables | ||
id: gitinfo | ||
run: | | ||
echo "Branch name: '${{ steps.branch-name.outputs.current_branch }}'" | ||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
echo "::set-output name=date::$(git show -s --date=format:'%Y-%m-%d' --format=%cd HEAD)" | ||
- name: MSVC Dev Cmd | ||
uses: ilammy/msvc-dev-cmd@v1.10.0 | ||
with: | ||
arch: x86 | ||
|
||
- name: Download WinBuilds | ||
uses: suisei-cn/actions-download-file@v1 | ||
with: | ||
url: "https://downloads.cncnet.org/WinBuilds32ForGitHubCI.zip" | ||
|
||
- name: Install WinBuilds | ||
run: | | ||
7z x WinBuilds32ForGitHubCI.zip -owin-builds-patch-32 | ||
Get-ChildItem | ||
Get-ChildItem -Path 'win-builds-patch-32' | ||
- name: Add WinBuilds To PATH | ||
run: | | ||
echo "$env:GITHUB_WORKSPACE\win-builds-patch-32" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
echo "$env:GITHUB_WORKSPACE\win-builds-patch-32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Build Binaries | ||
run: | | ||
Get-ChildItem | ||
New-Item -Path 'build\release' -ItemType Directory | ||
gmake clean | ||
gmake -j8 | ||
Move-Item -Path 'game.exe' -Destination 'build\release\Game.exe' | ||
New-Item -Path 'build\debug' -ItemType Directory | ||
gmake clean | ||
gmake -j8 WWDEBUG=1 | ||
Move-Item -Path 'game.exe' -Destination 'build\debug\Game.exe' | ||
Get-ChildItem -Path 'build\release' | ||
Get-ChildItem -Path 'build\debug' | ||
- name: Copy Binaries | ||
run: | | ||
New-Item -Path 'artifact\release' -ItemType Directory | ||
New-Item -Path 'artifact\debug' -ItemType Directory | ||
Move-Item -Path 'build\release\Game.exe' -Destination 'artifact\release\Game.exe' | ||
Move-Item -Path 'build\debug\Game.exe' -Destination 'artifact\debug\Game.exe' | ||
Get-ChildItem -Path 'artifact\release' | ||
Get-ChildItem -Path 'artifact\debug' | ||
Get-ChildItem | ||
Get-ChildItem -Path 'build' | ||
Get-ChildItem -Path 'artifact' | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ebfd-patches-${{ matrix.type }}-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}-${{ steps.gitinfo.outputs.date }} | ||
path: artifact | ||
|
||
- name: Create Archive For Release | ||
run: | | ||
Get-ChildItem -Path 'build' | ||
7z a ebfd-patches-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}.zip .\artifact\* | ||
- name: Upload New Release | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: Latest | ||
tag_name: latest | ||
body: Latest ebfd-patches binaries. | ||
files: | | ||
ebfd-patches-${{ steps.branch-name.outputs.current_branch }}-${{ steps.gitinfo.outputs.sha_short }}.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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