refactor a little. [skip CI] #556
Workflow file for this run
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: macOS | |
on: | |
push: | |
branches: [ main ] | |
tags: 'v*.*.*' | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macos-latest | |
if: "startsWith(github.ref, 'refs/tags/') || (!contains(github.event.head_commit.message, '[skip CI]') && !contains(github.event.head_commit.message, '[skip macOS]'))" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: macOS build | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
run: | | |
Tools/tolua++/build.sh | |
xcodebuild ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO -project Project/macOS/Dorothy.xcodeproj -target Dorothy | |
- name: Pack | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
rm -rf Assets/www | |
cd Tools/YarnEditor && unset NODE_OPTIONS && yarn && yarn build-linux && rm -rf ../dora-dora/public/yarn-editor && mv dist ../dora-dora/public/yarn-editor && cd ../.. | |
cd Tools/dora-dora && yarn && yarn build && cd ../.. && mv Tools/dora-dora/build Assets/www | |
cd $GITHUB_WORKSPACE | |
Tools/tolua++/build.sh | |
xcodebuild archive -project Project/macOS/Dorothy.xcodeproj -scheme Dorothy -configuration release -archivePath dorothy.xcarchive | |
cd dorothy.xcarchive/Products/Applications | |
zip -vr Dorothy.zip Dorothy.app | |
mv Dorothy.zip $GITHUB_WORKSPACE/dorothy-ssr-${{ github.ref_name }}-macos-universal.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
dorothy-ssr-${{ github.ref_name }}-macos-universal.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |