Skip to content

Commit

Permalink
build on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Flying-Tom committed Sep 10, 2024
1 parent 597da96 commit 74b5a87
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: MacOS Release

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

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

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

- 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
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@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: "${{github.workspace}}/release/TDGame-macos-${{github.ref_name}}.zip"
4 changes: 2 additions & 2 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 Down Expand Up @@ -43,4 +43,4 @@ jobs:
uses: softprops/action-gh-release@v1
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"
4 changes: 2 additions & 2 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 Down Expand Up @@ -53,4 +53,4 @@ jobs:
uses: softprops/action-gh-release@v1
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 74b5a87

Please sign in to comment.