Skip to content

Commit

Permalink
added Mac ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Oct 14, 2023
1 parent ad91b2d commit a90425a
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 69 deletions.
1 change: 0 additions & 1 deletion .github/scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ OpenPonk might encounter some error when used with some Linux distros. In that c
After Pharo is installed, you may run OpenPonk using $PROJECT_NAME-pharo-ui executable.
EOF

cat ".github/scripts/readmecommon.txt" >> "$package_dir/README.txt"
Expand Down
15 changes: 14 additions & 1 deletion .github/scripts/build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -euxo pipefail
ci_build_dir=$SMALLTALK_CI_BUILD
package_dir="$PROJECT_NAME-$PLATFORM"
vm_dir=`cat $SMALLTALK_CI_VM | sed 's|\(.*\)/.*|\1|'`/pharo-vm
package_dir_arm="$PROJECT_NAME-$PLATFORM-ARM"
vm_dir_arm=arm-pharo-vm

mkdir -p "$package_dir/image"

Expand Down Expand Up @@ -73,11 +75,22 @@ Second option:
Opening:
1) Double click $PROJECT_NAME (Unix executable)
EOF

cat ".github/scripts/readmecommon.txt" >> "$package_dir/README.txt"

$vm_dir/Pharo.app/Contents/MacOS/Pharo --headless $package_dir/image/$PROJECT_NAME.image eval --save "OPVersion currentWithRunId: $RUN_ID projectName: '$REPOSITORY_NAME'"

zip -qr $PROJECT_NAME-$PLATFORM-$VERSION.zip $package_dir

# ARM variant
mkdir -p "$vm_dir_arm"
mkdir -p "$package_dir_arm"

wget "https://files.pharo.org/get-files/${PHARO_VERSION}0/pharo-vm-Darwin-arm64-stable.zip"
unzip pharo-vm-Darwin-arm64-stable.zip -d "$vm_dir_arm"
cp -r "$package_dir"/* "$package_dir_arm"
rm -rf "$package_dir_arm/Pharo.app"
cp -r $vm_dir_arm/Pharo.app/ $package_dir_arm/Pharo.app

zip -qr $PROJECT_NAME-$PLATFORM-ARM-$VERSION.zip $package_dir_arm
1 change: 1 addition & 0 deletions .github/scripts/readmecommon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ Zoom in/out: +/-
Delete element: Delete (with confirmation dialog) or Ctrl+Delete (without confirmation)
Hide element: Ctrl+H
Save OpenPonk environment (option 1 save): Ctrl+Shift+S

130 changes: 90 additions & 40 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,37 @@ env:
VERSION: 'nightly'
cache-name: zip-cache
RUN_ID: ${{ github.run_id }}
PHARO_VERSION: 11

jobs:

build-linux:
runs-on: ubuntu-latest
build-win:
runs-on: windows-latest
env:
PLATFORM: linux
name: 'Build Linux'
PLATFORM: win
name: 'Build Windows'
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Load SmalltalkCI environment
uses: hpi-swa/[email protected]
id: smalltalkci
with:
smalltalk-image: Pharo64-11
smalltalk-image: Pharo64-${{ env.PHARO_VERSION }}
- name: Prepare scripts directory
run: mkdir -p .github/scripts
run: md -Force .github/scripts
- name: Download Pharo preLoad script
run: curl -o .github/scripts/preLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/preLoad.st
- name: Download Pharo postLoad script
run: curl -o .github/scripts/postLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/postLoad.st
- name: Download zip script
run: curl -o .github/scripts/build-linux.sh https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-linux.sh
- name: Prepare image and test
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }}
shell: bash
timeout-minutes: 12
- name: Prepare zip script
run: chmod u+x .github/scripts/build-linux.sh
timeout-minutes: 20
- name: Download zip script
run: curl -o .github/scripts/build-win.ps1 https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-win.ps1
- name: Create zip
run: .github/scripts/build-linux.sh
run: .github/scripts/build-win.ps1
env:
ACTIONS_READ_ACCESS_TOKEN: ${{ secrets.ACTIONS_READ_ACCESS_TOKEN }}
- name: Cache zip
Expand All @@ -66,35 +65,35 @@ jobs:
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip

build-mac:
runs-on: macos-latest
build-linux:
runs-on: ubuntu-latest
env:
PLATFORM: mac
name: 'Build Mac'
PLATFORM: linux
name: 'Build Linux'
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Load SmalltalkCI environment
uses: hpi-swa/[email protected]
id: smalltalkci
with:
smalltalk-image: Pharo64-11
smalltalk-image: Pharo64-${{ env.PHARO_VERSION }}
- name: Prepare scripts directory
run: mkdir -p .github/scripts
- name: Download Pharo preLoad script
run: curl -o .github/scripts/preLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/preLoad.st
- name: Download Pharo postLoad script
run: curl -o .github/scripts/postLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/postLoad.st
- name: Download zip script
run: curl -o .github/scripts/build-linux.sh https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-linux.sh
- name: Prepare image and test
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }}
shell: bash
timeout-minutes: 12
- name: Download zip script
run: curl -o .github/scripts/build-mac.sh https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-mac.sh
- name: Prepare zip script
run: chmod u+x .github/scripts/build-mac.sh
run: chmod u+x .github/scripts/build-linux.sh
- name: Create zip
run: .github/scripts/build-mac.sh
run: .github/scripts/build-linux.sh
env:
ACTIONS_READ_ACCESS_TOKEN: ${{ secrets.ACTIONS_READ_ACCESS_TOKEN }}
- name: Cache zip
Expand All @@ -103,40 +102,47 @@ jobs:
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip

build-win:
runs-on: windows-latest
build-mac:
runs-on: macos-latest
env:
PLATFORM: win
name: 'Build Windows'
PLATFORM: mac
name: 'Build Mac'
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Load SmalltalkCI environment
uses: hpi-swa/[email protected]
id: smalltalkci
with:
smalltalk-image: Pharo64-11
smalltalk-image: Pharo64-${{ env.PHARO_VERSION }}
- name: Prepare scripts directory
run: md -Force .github/scripts
run: mkdir -p .github/scripts
- name: Download Pharo preLoad script
run: curl -o .github/scripts/preLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/preLoad.st
- name: Download Pharo postLoad script
run: curl -o .github/scripts/postLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/postLoad.st
- name: Prepare image and test
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }}
shell: bash
timeout-minutes: 20
timeout-minutes: 12
- name: Download zip script
run: curl -o .github/scripts/build-win.ps1 https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-win.ps1
run: curl -o .github/scripts/build-mac.sh https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-mac.sh
- name: Prepare zip script
run: chmod u+x .github/scripts/build-mac.sh
- name: Create zip
run: .github/scripts/build-win.ps1
run: .github/scripts/build-mac.sh
env:
ACTIONS_READ_ACCESS_TOKEN: ${{ secrets.ACTIONS_READ_ACCESS_TOKEN }}
- name: Cache zip
- name: Cache Intel zip
uses: actions/cache/[email protected]
with:
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
- name: Cache ARM zip
uses: actions/cache/[email protected]
with:
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-ARM-${{ env.VERSION }}.zip
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-ARM-${{ env.VERSION }}.zip

check-linux-cache:
needs: build-linux
Expand All @@ -155,10 +161,10 @@ jobs:
if: steps.get-zip.outputs.cache-hit != 'true'
run: exit 1

check-mac-cache:
check-mac-intel-cache:
needs: build-mac
runs-on: macos-latest
name: 'Check Mac zip is created'
name: 'Check Mac Intel zip is created'
env:
PLATFORM: mac
steps:
Expand All @@ -172,6 +178,23 @@ jobs:
if: steps.get-zip.outputs.cache-hit != 'true'
run: exit 1

check-mac-arm-cache:
needs: build-mac
runs-on: macos-latest
name: 'Check Mac ARM zip is created'
env:
PLATFORM: mac-ARM
steps:
- name: Get zip from cache
id: get-zip
uses: actions/cache/[email protected]
with:
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
- name: Fail on cache miss
if: steps.get-zip.outputs.cache-hit != 'true'
run: exit 1

check-win-cache:
needs: build-win
runs-on: windows-latest
Expand All @@ -191,7 +214,7 @@ jobs:


save-stats:
needs: [check-linux-cache, check-mac-cache, check-win-cache]
needs: [check-win-cache, check-linux-cache, check-mac-intel-cache, check-mac-arm-cache]
runs-on: ubuntu-latest
name: 'Save dl stats of previous build'
env:
Expand Down Expand Up @@ -230,6 +253,33 @@ jobs:
prerelease: true
title: "nightly"

upload-win-zip:
needs: create-release
runs-on: windows-latest
name: 'Upload Windows zip'
env:
PLATFORM: win
steps:
- name: Get zip from cache
id: get-zip
uses: actions/cache/[email protected]
with:
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
- name: Get Release by Tag
id: get_release_by_tag
uses: jonfriesen/[email protected]
with:
tag_name: nightly
- name: Upload zip
id: upload-zip
uses: actions/[email protected]
with:
upload_url: ${{ steps.get_release_by_tag.outputs.upload_url }}
asset_path: ./${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
asset_content_type: application/zip

upload-linux-zip:
needs: create-release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -257,10 +307,10 @@ jobs:
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
asset_content_type: application/zip

upload-mac-zip:
upload-mac-intel-zip:
needs: create-release
runs-on: macos-latest
name: 'Upload Mac zip'
name: 'Upload Mac Intel zip'
env:
PLATFORM: mac
steps:
Expand All @@ -284,12 +334,12 @@ jobs:
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
asset_content_type: application/zip

upload-win-zip:
upload-mac-arm-zip:
needs: create-release
runs-on: windows-latest
name: 'Upload Windows zip'
runs-on: macos-latest
name: 'Upload Mac ARM zip'
env:
PLATFORM: win
PLATFORM: mac-ARM
steps:
- name: Get zip from cache
id: get-zip
Expand Down
Loading

0 comments on commit a90425a

Please sign in to comment.