Release (266) #266
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: Build | |
run-name: "${{ contains(github.ref, 'refs/tags/') && 'Release' || 'Build' }} (${{ github.run_number }})" | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer | |
BUILD_NUMBER: 3709 | |
YEAR: 2024 | |
FORK_BUILD_NAME: b | |
jobs: | |
source-code: | |
name: Check out and process source code | |
if: "!contains(github.ref, 'refs/tags/') || github.repository == 'pouwelsjochem/solar2d'" | |
runs-on: macos-13 | |
steps: | |
- run: CDR="$(basename "$(pwd)")" ; cd .. ; rm -rf "$CDR" ; mkdir -p "$CDR" ; cd "$CDR" | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- run: ./tools/GHAction/daily_env.sh | |
- name: Set daily build | |
run: ./tools/GHAction/process_sources.sh | |
- name: Upload Source bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SourceCode | |
path: ./output | |
Xcode-template-matrix: | |
strategy: | |
matrix: | |
runner: | |
- macos-14 | |
xcode: | |
- Xcode_16 | |
- Xcode_15.4 | |
target: | |
- template | |
- template-angle | |
platform: | |
- iphone | |
- tvos | |
needs: source-code | |
runs-on: ${{ matrix.runner }} | |
env: | |
DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer | |
TEMPLATE_TARGET: ${{ matrix.target }} | |
TEMPLATE_PLATFORM: ${{ matrix.platform }} | |
S2D_MIN_VER_IOS: "13.0" | |
S2D_MIN_VER_TVOS: "13.0" | |
S2D_MIN_VER_MACOS: "10.15" | |
steps: | |
- run: CDR="$(basename "$(pwd)")" ; cd .. ; rm -rf "$CDR" ; mkdir -p "$CDR" ; cd "$CDR" | |
- name: Get processed code | |
uses: actions/download-artifact@v4 | |
with: | |
name: SourceCode | |
path: SourceCode | |
- name: Unpack source code | |
run: tar -xzf SourceCode/corona.tgz | |
- run: ./tools/GHAction/daily_env.sh | |
- name: Build templates | |
working-directory: ./platform/${{ matrix.platform }} | |
run: ./gh_build_templates.sh | |
env: | |
CERT_PASSWORD: ${{ secrets.CertPassword }} | |
- name: Build templates JSON spec | |
run: ./tools/GHAction/generate_xcode_jsons.py | |
- name: Upload templates | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Templates-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.target }} | |
path: ./output | |
collect-ios-templates: | |
needs: | |
- Xcode-template-matrix | |
runs-on: ubuntu-20.04 | |
if: (! failure() && ! cancelled()) | |
steps: | |
- run: CDR="$(basename "$(pwd)")" ; cd .. ; rm -rf "$CDR" ; mkdir -p "$CDR" ; cd "$CDR" | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- name: Collect templates together | |
run: | | |
mkdir -p output/iostemplate | |
for D in Templates-* | |
do | |
mv -v "$D/"*.tar.bz output/iostemplate | |
done | |
- name: Generate template JSON | |
run: find Templates-* -name '*_*-SDKs.json' -exec ./tools/GHAction/aggregate_xcode_jsons.py output {} \+ | |
- name: Upload templates | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Collected-ios-templates | |
path: ./output | |
native: | |
needs: source-code | |
runs-on: macos-13 | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer | |
steps: | |
- run: CDR="$(basename "$(pwd)")" ; cd .. ; rm -rf "$CDR" ; mkdir -p "$CDR" ; cd "$CDR" | |
- name: Get processed code | |
uses: actions/download-artifact@v4 | |
with: | |
name: SourceCode | |
path: SourceCode | |
- name: Unpack source code | |
run: tar -xzf SourceCode/corona.tgz | |
- run: ./tools/GHAction/daily_env.sh | |
- name: Build Native | |
run: JAVA_HOME="${JAVA_HOME_17_X64:-$JAVA_HOME_17_arm64}" ./tools/GHAction/build_native.sh | |
env: | |
CERT_PASSWORD: ${{ secrets.CertPassword }} | |
- name: Upload Corona Native | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Native | |
path: ./output | |
macOS-Simulator: | |
needs: | |
- source-code | |
- collect-ios-templates | |
- native | |
runs-on: macos-14 | |
steps: | |
- run: CDR="$(basename "$(pwd)")" ; cd .. ; rm -rf "$CDR" ; mkdir -p "$CDR" ; cd "$CDR" | |
- name: Get processed code | |
uses: actions/download-artifact@v4 | |
with: | |
name: SourceCode | |
path: SourceCode | |
- name: Unpack source code | |
run: tar -xzf SourceCode/corona.tgz | |
- run: ./tools/GHAction/daily_env.sh | |
- name: Check for macOS min supported version | |
run: exit $( echo $(cat platform/mac/AppDelegate.mm | perl -ne 'print for /kosVersionCurrent = @"([0-9.]+)"/') ' < ' $(/usr/bin/xcrun --sdk macosx --show-sdk-version) | bc ) | |
- name: Get collected templates | |
uses: actions/download-artifact@v4 | |
with: | |
name: Collected-ios-templates | |
path: Collected-ios-templates | |
- name: Put collected iOS templates in place | |
run: cp -Rv Collected-ios-templates/* platform/resources/ | |
- run: mkdir docs | |
- name: Get Native | |
uses: actions/download-artifact@v4 | |
with: | |
name: Native | |
path: Native | |
- name: Put JRE in place | |
shell: bash | |
run: | | |
curl -sL https://github.com/coronalabs/binary-data/releases/download/1.0/jre.macos.tgz -o jre.macos.tgz | |
- name: required for appdmg | |
run: brew install python-setuptools | |
- name: install appdmg | |
run: npm install -g appdmg | |
- name: install imagemagick | |
run: brew install imagemagick gs || true | |
- name: freshen icu4c for node | |
run: brew upgrade icu4c || brew install icu4c | |
- name: Build DMG | |
run: ./tools/GHAction/build_dmg.sh | |
env: | |
CERT_PASSWORD: ${{ secrets.CertPassword }} | |
- name: Notarize | |
run: | | |
[ -n "$APPLE_ISSUER" ] || exit 0 | |
APPLE_KEY_FILE="$(mktemp)" | |
echo "$APPLE_KEY" > "$APPLE_KEY_FILE" | |
xcrun notarytool submit --key "$APPLE_KEY_FILE" --issuer "$APPLE_ISSUER" --key-id "$APPLE_KEY_ID" --wait ./output/*.dmg | |
xcrun stapler staple ./output/*.dmg | |
shell: bash | |
env: # get this at https://appstoreconnect.apple.com/access/api | |
APPLE_KEY: ${{ secrets.AppleKey }} ## full contents of the file | |
APPLE_KEY_ID: ${{ secrets.AppleKeyId }} | |
APPLE_ISSUER: ${{ secrets.AppleIssuer }} | |
- name: Upload macOS Daily build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Simulator-macOS | |
path: ./output | |
check-notarization: | |
runs-on: macos-14 | |
steps: | |
- name: Check notarization credentials | |
run: | | |
[ -n "$APPLE_ISSUER" ] || exit 0 | |
T="R7NmWb1brmEx65" | |
echo "::add-mask::$T" | |
Z="cNgt1OO-" | |
echo "::add-mask::$Z" | |
APPLE_KEY_FILE="$(mktemp)" | |
echo "$APPLE_KEY" > "$APPLE_KEY_FILE" | |
if ! xcrun notarytool history --key "$APPLE_KEY_FILE" --issuer "$APPLE_ISSUER" --key-id "$APPLE_KEY_ID" &> /dev/null | |
then | |
curl -X POST -H "Content-Type: application/json" -d '{"value1":"'$GITHUB_REPOSITORY'"}' https://maker.ifttt.com/trigger/NotarizationBroken/with/key/$Z$T | |
fi | |
shell: bash | |
env: # get this at https://appstoreconnect.apple.com/access/api | |
APPLE_KEY: ${{ secrets.AppleKey }} | |
APPLE_KEY_ID: ${{ secrets.AppleKeyId }} | |
APPLE_ISSUER: ${{ secrets.AppleIssuer }} | |
Windows-Simulator: | |
needs: | |
- source-code | |
- native | |
runs-on: windows-2019 | |
steps: | |
- name: Get processed code | |
uses: actions/download-artifact@v4 | |
with: | |
name: SourceCode | |
path: SourceCode | |
- name: Unpack source code | |
run: | | |
7z x SourceCode/corona.tgz | |
7z x corona.tar | |
# - name: Checkout Switch specific source code (under NDA) | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: pouwelsjochem/solar2d-platform-switch | |
# token: ${{ secrets.PLATFORM_SWITCH_REPO_PAT }} | |
# path: platform\switch | |
# - name: Checkout Switch CI (under NDA) | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: pouwelsjochem/nintendo-setup-ci | |
# ref: "2.5.5" | |
# token: ${{ secrets.NINTENDO_SETUP_CI_REPO_PAT }} | |
# path: platform\switch\ci | |
- run: ./tools/GHAction/daily_env.sh | |
shell: bash | |
- run: mkdir -f docs | |
- name: Move docs outside the directory | |
run: mv docs ../docs | |
- name: Get Corona Native | |
uses: actions/download-artifact@v4 | |
with: | |
name: Native | |
path: Native | |
- name: Put native in place | |
shell: cmd | |
run: | | |
mkdir "%WORKSPACE%\platform\windows\Bin" | |
cd "%WORKSPACE%\platform\windows\Bin" | |
rmdir /s /q "Native" | |
tar -xvzf "%WORKSPACE%\Native\CoronaNative.tar.gz" | |
rm ._CoronaEnterprise | |
mv CoronaEnterprise Native | |
del /q /f Native\.* | |
del /q /f Native\Icon? | |
del /q /f /s Native\Corona\tvos\frameworks\CoronaCards.framework | |
- name: Put JRE in place | |
shell: bash | |
run: | | |
curl -sL https://github.com/coronalabs/binary-data/releases/download/1.0/jre.win32.7z -o jre.win32.7z | |
7z x jre.win32.7z -o"platform/windows/Bin" -y | |
- name: Put redistributables in place | |
shell: bash | |
run: | | |
curl -sL https://github.com/coronalabs/binary-data/releases/download/1.0/redist.win32.7z -o redist.win32.7z | |
7z x redist.win32.7z -o"platform/windows/Bin/redist" -y | |
# - name: Configure Nintendo SDK | |
# shell: pwsh | |
# run: | | |
# ."platform\switch\ci\ndi_setup-2.5.5.exe" /SILENT | |
# ."$env:ProgramFiles\Nintendo\Nintendo Dev Interface\NDICmd.exe" -gs CreateEx -name NintendoSDK -root C:\Nintendo -platform NX -version 14.3.0 | |
# - name: Put nxtemplate in place | |
# shell: cmd | |
# run: | | |
# call platform\switch\build_release_template.bat | |
# mv platform\switch\nxtemplate platform\windows\Bin\Corona\Resources | |
- name: Build Corona Simulator | |
shell: cmd | |
run: | | |
cd platform\windows | |
call UpdateFileVersions.bat %BUILD_NUMBER% | |
call Build.Tools\VSVars.bat | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat" | |
devenv "Corona.SDK.sln" /rebuild "Release|x86" | |
env: | |
WIN_CERT_PASSWORD: ${{ secrets.WinCertPassword }} | |
- name: Copy Simulator | |
run: | | |
mkdir output | |
cp -v ./platform/windows/Bin/Corona.SDK.Installer/Corona.msi output/Solar2D-${{ env.YEAR }}.${{ env.BUILD }}.${{ env.FORK_BUILD_NAME }}.msi | |
shell: bash | |
- name: Upload Windows Corona artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Simulator-Windows | |
path: ./output | |
release: | |
if: startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-20.04 | |
needs: | |
- Windows-Simulator | |
- macOS-Simulator | |
- native | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ./tools/GHAction/daily_env.sh | |
- name: Generate Change Log | |
run: | | |
git fetch --prune --unshallow | |
git fetch origin '+refs/tags/*:refs/tags/*' | |
GIT_LOG=$(git log --format='* %s (%h)' --branches=master --ancestry-path $(git describe --tags --abbrev=0 $GITHUB_REF^)..$(git describe --tags --abbrev=0 $GITHUB_REF)) || true | |
if [ -n "$GIT_LOG" ] | |
then | |
GIT_LOG="Changes since previous build: | |
$GIT_LOG | |
" | |
else | |
GIT_LOG='See https://github.com/pouwelsjochem/solar2d for details | |
' | |
fi | |
echo 'GIT_LOG<<EOF' >> $GITHUB_ENV | |
echo "$GIT_LOG" >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
echo "$GIT_LOG" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Simulator-macOS | |
path: Simulator-macOS | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Simulator-Windows | |
path: Simulator-Windows | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Native | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Solar2D ${{ env.YEAR }}.${{ env.BUILD }}.${{ env.FORK_BUILD_NAME }} | |
body: ${{ env.GIT_LOG }} | |
- name: Upload Release Asset for macOS Simulator | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Simulator-macOS/Solar2D-${{ env.YEAR }}.${{ env.BUILD }}.${{ env.FORK_BUILD_NAME }}.dmg | |
asset_name: Solar2D-macOS-${{ env.YEAR }}.${{ env.BUILD }}.${{ env.FORK_BUILD_NAME }}.dmg | |
asset_content_type: application/x-apple-diskimage | |
- name: Upload Release Asset for Windows Simulator | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Simulator-Windows/Solar2D-${{ env.YEAR }}.${{ env.BUILD }}.${{ env.FORK_BUILD_NAME }}.msi | |
asset_name: Solar2D-Windows-${{ env.YEAR }}.${{ env.BUILD }}.${{ env.FORK_BUILD_NAME }}.msi | |
asset_content_type: application/x-msi |