diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcce3c9..8405098 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,10 @@ on: # branches: ["*"] jobs: + ## + ## Windows + ## + windows-cmake-build: runs-on: windows-latest steps: @@ -23,7 +27,7 @@ jobs: uses: lukka/get-cmake@v3.21.2 - uses: actions/checkout@v2 - + - name: Compile The Great Escape for Windows (via CMake) run: | cmake -E make_directory ${{github.workspace}}\build @@ -31,6 +35,10 @@ jobs: cmake ${{github.workspace}} cmake --build . + ## + ## macOS + ## + macos-build: runs-on: macos-10.15 steps: @@ -41,18 +49,86 @@ jobs: macos-cmake-build: runs-on: macos-10.15 + + outputs: + version: ${{ steps.version.outputs.version }} + leafname: ${{ steps.version.outputs.leafname }} + + # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: get-cmake uses: lukka/get-cmake@v3.21.2 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - name: Compile The Great Escape for macOS (via CMake) run: | - mkdir -p build && cd build - cmake -GNinja .. + mkdir -p ${{github.workspace}}/build + cd ${{github.workspace}}/build + cmake -GNinja ${{github.workspace}} cmake --build . + - name: Give the output a versioned name + id: version + run: | + version=$(git rev-parse --short HEAD) + echo "This is version: $version" + leafname="TheGreatEscape-$version-macOS.zip" + + echo "::set-output name=version::$version" + echo "::set-output name=leafname::$leafname" + + - name: Archive it + run: | + cd ${{github.workspace}}/build/platform/osx + zip -9r ${{ steps.version.outputs.leafname }} TheGreatEscape.app + + - uses: actions/upload-artifact@v3 + with: + name: The-Great-Escape-macOS + path: ${{github.workspace}}/build/platform/osx/${{ steps.version.outputs.leafname }} + if-no-files-found: error + + # The release only triggers when the thing that was pushed was a tag starting with 'macos-' + macos-release: + needs: macos-cmake-build + runs-on: macos-10.15 + if: startsWith(github.ref, 'refs/tags/macos-') + steps: + - name: Download built binary + uses: actions/download-artifact@v1 + with: + name: The-Great-Escape-macOS + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ needs.macos-cmake-build.outputs.version }} + draft: true + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. + # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: The-Great-Escape-macOS/${{ needs.macos-cmake-build.outputs.leafname }} + asset_name: ${{ needs.macos-cmake-build.outputs.leafname }} + asset_content_type: application/zip + + ## + ## RISC OS + ## + riscos-build: # The type of runner that the job will run on container: riscosdotinfo/riscos-gccsdk-4.7:latest @@ -83,7 +159,7 @@ jobs: version=$(git rev-parse --short HEAD) fi echo "This is version: $version" - leafname="TheGreatEscape-$version.zip" + leafname="TheGreatEscape-$version-RISC_OS.zip" echo "::set-output name=version::$version" echo "::set-output name=leafname::$leafname" @@ -96,10 +172,11 @@ jobs: find . -type f -not -name '*,*' -exec mv '{}' '{},fff' \; # ensure that type-less files come out as Text python3 -m rozipfile --verbose --create ../../${{ steps.version.outputs.leafname }} * - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: - name: The-Great-Escape + name: The-Great-Escape-RISC_OS path: ${{ steps.version.outputs.leafname }} + if-no-files-found: error # The artifact that is downloadable from the Actions is actually a zip of the artifacts # that we supply. So it will be a regular Zip file containing a RISC OS Zip file. @@ -112,7 +189,7 @@ jobs: - name: Download built binary uses: actions/download-artifact@v1 with: - name: The-Great-Escape + name: The-Great-Escape-RISC_OS - name: Create Release id: create_release @@ -132,7 +209,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. - # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: The-Great-Escape/${{ needs.riscos-build.outputs.leafname }} asset_name: ${{ needs.riscos-build.outputs.leafname }} diff --git a/platform/osx/CMakeLists.txt b/platform/osx/CMakeLists.txt index cd04d8b..edc37e8 100644 --- a/platform/osx/CMakeLists.txt +++ b/platform/osx/CMakeLists.txt @@ -94,7 +94,7 @@ add_custom_command( # Make sure the 'Resources' directory is correctly created before we build add_custom_command(TARGET TheGreatEscapeApp PRE_BUILD - COMMAND mkdir -p ./\${CONFIGURATION}/TheGreatEscape.app/Contents/Resources) + COMMAND mkdir -p ./TheGreatEscape.app/Contents/Resources) # Place resource files in Resources/* set_source_files_properties(${RESOURCES} @@ -118,6 +118,6 @@ foreach(xib ${XIBS}) COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text - --compile ./\${CONFIGURATION}/TheGreatEscape.app/Contents/Resources/${xib}.nib ${RESOURCES_SOURCE_DIR}/${xib}.xib + --compile ./TheGreatEscape.app/Contents/Resources/${xib}.nib ${RESOURCES_SOURCE_DIR}/${xib}.xib COMMENT "Compiling ${xib}.xib") endforeach()