Skip to content

Commit

Permalink
Merge pull request #3 from Flying-Tom/ci-test
Browse files Browse the repository at this point in the history
Add macos build
  • Loading branch information
Flying-Tom authored Sep 10, 2024
2 parents 597da96 + 369f261 commit 2699101
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 12 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: MacOS Release

on:
push:
branches:
- main
tags:
- "v*.*.*"

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: macos-12

steps:
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
host: "mac"

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Pack Resources
if: startsWith(github.ref, 'refs/tags/v')
run: |
mkdir ${{github.workspace}}/release/
cp ${{github.workspace}}/build/TDGame ${{github.workspace}}/release/
cp -r ${{github.workspace}}/resource/maps/ ${{github.workspace}}/release/
- name: Archive Release
uses: thedoctor0/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
type: "zip"
directory: ${{github.workspace}}/release/
filename: "TDGame-macos-${{github.ref_name}}.zip"

- name: Upload Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: "${{github.workspace}}/release/TDGame-macos-${{github.ref_name}}.zip"
14 changes: 8 additions & 6 deletions .github/workflows/release-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Ubuntu Release
on:
push:
branches:
- master
- main
tags:
- "v*.*.*"

Expand All @@ -15,32 +15,34 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Pack Resources
if: startsWith(github.ref, 'refs/tags/v')
run: |
mkdir ${{github.workspace}}/release/
cp ${{github.workspace}}/build/TDGame ${{github.workspace}}/release/
cp -r ${{github.workspace}}/resource/maps/ ${{github.workspace}}/release/
- name: Archive Release
uses: thedoctor0/zip-release@master
uses: thedoctor0/zip-release@0.7.5
if: startsWith(github.ref, 'refs/tags/v')
with:
type: "zip"
directory: ${{github.workspace}}/release/
filename: "TDGame-Ubuntu-${{github.ref_name}}.zip"

- name: Upload Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: "${{github.workspace}}/release/TDGame-Ubuntu-${{github.ref_name}}.zip"
files: "${{github.workspace}}/release/TDGame-ubuntu-${{github.ref_name}}.zip"
13 changes: 7 additions & 6 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Windows Release
on:
push:
branches:
- master
- main
tags:
- "v*.*.*"

Expand All @@ -15,15 +15,15 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: x64

- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v4
with:
arch: "win64_mingw81"

Expand All @@ -41,16 +41,17 @@ jobs:
Xcopy /E /I ${{github.workspace}}\resource\maps ${{github.workspace}}\release\maps
cd ${{env.Qt5_Dir}}/bin/
./windeployqt.exe ${{github.workspace}}\release\TDGame.exe
- name: Archive Release
uses: thedoctor0/zip-release@master
uses: thedoctor0/zip-release@0.7.5
if: startsWith(github.ref, 'refs/tags/v')
with:
type: "zip"
directory: ${{github.workspace}}/release/
filename: "TDGame-Windows-${{github.ref_name}}.zip"

- name: Upload Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
files: "${{github.workspace}}/release/TDGame-Windows-${{github.ref_name}}.zip"
files: "${{github.workspace}}/release/TDGame-windows-${{github.ref_name}}.zip"

0 comments on commit 2699101

Please sign in to comment.