Skip to content

Commit

Permalink
Merge pull request #685 from tcsabina/master
Browse files Browse the repository at this point in the history
CI/CD Pipelines
  • Loading branch information
tcsabina authored Oct 4, 2022
2 parents ca25d05 + 39479ac commit f239843
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 22 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/build-and-deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: build and deploy snapshots
on:
release:
types: [published]
jobs:
build:
if: github.repository == 'QW-Group/ezquake-source'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
target: [windows-glsl-x64, windows-opengl-x64, windows-combined-x64]
include:
- target: windows-glsl-x64
config: rls-modern
platform: x64
- target: windows-opengl-x64
config: rls-classic
platform: x64
- target: windows-combined-x64
config: rls-all
platform: x64

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Build txt2c
run: msbuild misc\vstudio\txt2c\txt2c.vcxproj -t:rebuild -property:Configuration=Release

- name: Make dir
run: mkdir .vs

- name: Copy txt2c
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }}

- name: Create checksum
run: |
md5sum .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.exe > .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.md5
- name: Invoke msys
uses: msys2/setup-msys2@v2
with:
install: openssh

- name: Setup SSH
shell: msys2 {0}
env:
SSH_AUTH_SOCK: C:\ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
- name: Set date
shell: msys2 {0}
run: |
#timedatectl set-timezone Europe/Amsterdam
export TZ=CET-1CEST
echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV
- name: Deploy
shell: msys2 {0}
env:
SSH_AUTH_SOCK: C:\ssh_agent.sock
run: |
mkdir -p upload/releases/${{ matrix.platform }}/${{ matrix.config }}
mkdir -p upload/releases/latest/${{ matrix.platform }}/${{ matrix.config }}
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.exe upload/releases/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.exe
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.md5 upload/releases/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.md5
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.exe upload/releases/latest/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.md5 upload/releases/latest/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5
sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/releases <<< $'put -rp upload/releases/*'
74 changes: 74 additions & 0 deletions .github/workflows/build-and-deploy-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: build and deploy snapshots
on: [push]
jobs:
build:
if: github.repository == 'QW-Group/ezquake-source'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
target: [windows-glsl-x64, windows-opengl-x64, windows-combined-x64]
include:
- target: windows-glsl-x64
config: rls-modern
platform: x64
- target: windows-opengl-x64
config: rls-classic
platform: x64
- target: windows-combined-x64
config: rls-all
platform: x64

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Build txt2c
run: msbuild misc\vstudio\txt2c\txt2c.vcxproj -t:rebuild -property:Configuration=Release

- name: Make dir
run: mkdir .vs

- name: Copy txt2c
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }}

- name: Create checksum
run: |
md5sum .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.exe > .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.md5
- name: Invoke msys
uses: msys2/setup-msys2@v2
with:
install: openssh

- name: Setup SSH
shell: msys2 {0}
env:
SSH_AUTH_SOCK: C:\ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
- name: Set date
shell: msys2 {0}
run: |
#timedatectl set-timezone Europe/Amsterdam
export TZ=CET-1CEST
echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV
- name: Deploy
shell: msys2 {0}
env:
SSH_AUTH_SOCK: C:\ssh_agent.sock
run: |
mkdir -p upload/snapshots/${{ matrix.platform }}/${{ matrix.config }}
mkdir -p upload/snapshots/latest/${{ matrix.platform }}/${{ matrix.config }}
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.exe upload/snapshots/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.exe
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.md5 upload/snapshots/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.md5
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.exe upload/snapshots/latest/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.md5 upload/snapshots/latest/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5
sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/snapshots <<< $'put -rp upload/snapshots/*'
45 changes: 45 additions & 0 deletions .github/workflows/build-targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build targets
on: [pull_request]
jobs:
build:
if: github.repository == 'QW-Group/ezquake-source'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
target: [windows-glsl-x64, windows-opengl-x64, windows-combined-x64]
include:
- target: windows-glsl-x64
config: rls-modern
platform: x64
- target: windows-opengl-x64
config: rls-classic
platform: x64
- target: windows-combined-x64
config: dbg-all
platform: x64

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Build txt2c
run: msbuild misc\vstudio\txt2c\txt2c.vcxproj -t:rebuild -property:Configuration=Release

- name: Make dir
run: mkdir .vs

- name: Copy txt2c
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }}

- name: Archive client
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.exe
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.*
!.travis.yml
ezquake
ezquake.exe
Expand Down
8 changes: 4 additions & 4 deletions ezQuake.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30611.23
# Visual Studio Version 17
VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ezQuake", "ezQuake.vcxproj", "{5147CA71-1D3D-4F61-9847-87B36421C323}"
ProjectSection(ProjectDependencies) = postProject
Expand Down Expand Up @@ -85,8 +85,8 @@ Global
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|Any CPU.Build.0 = dbg-all|Win32
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|ARM.ActiveCfg = rls-all|Win32
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|ARM64.ActiveCfg = rls-all|Win32
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|x64.ActiveCfg = dbg-all|x64
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|x64.Build.0 = dbg-all|x64
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|x64.ActiveCfg = rls-all|x64
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|x64.Build.0 = rls-all|x64
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|x86.ActiveCfg = dbg-all|Win32
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-all|x86.Build.0 = dbg-all|Win32
{5147CA71-1D3D-4F61-9847-87B36421C323}.rls-classic|Any CPU.ActiveCfg = rls-classic|Win32
Expand Down
Loading

0 comments on commit f239843

Please sign in to comment.