-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macOS: Add a release action to ci.yml
- I had to delete use of ${CONFIGURATION} from the macOS xib handling which seems to be set on the CI environment, but not locally for me.
- Loading branch information
Showing
2 changed files
with
87 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,21 +16,29 @@ on: | |
# branches: ["*"] | ||
|
||
jobs: | ||
## | ||
## Windows | ||
## | ||
|
||
windows-cmake-build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: get-cmake | ||
uses: lukka/[email protected] | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Compile The Great Escape for Windows (via CMake) | ||
run: | | ||
cmake -E make_directory ${{github.workspace}}\build | ||
cd ${{github.workspace}}\build | ||
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/[email protected] | ||
|
||
# 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 }} | ||
|
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