Skip to content

Commit 7d89dae

Browse files
Merge 2102a0f
2 parents c600145 + 2102a0f commit 7d89dae

6 files changed

Lines changed: 205 additions & 18 deletions

File tree

.github/scripts/build-linux.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@ ci_build_dir=$SMALLTALK_CI_BUILD
66
package_dir="$PROJECT_NAME-$PLATFORM"
77
vm_dir=`cat $SMALLTALK_CI_VM | sed 's|\(.*\)/.*|\1|'`/pharo-vm
88

9-
mkdir -p "$package_dir"
9+
mkdir -p "$package_dir/image"
10+
mkdir -p "$package_dir/pharo"
1011

11-
cp $ci_build_dir/TravisCI.image $package_dir/$PROJECT_NAME.image
12-
cp $ci_build_dir/TravisCI.changes $package_dir/$PROJECT_NAME.changes
13-
cp $ci_build_dir/*.sources $package_dir
12+
cp $ci_build_dir/TravisCI.image $package_dir/image/$PROJECT_NAME.image
13+
cp $ci_build_dir/TravisCI.changes $package_dir/image/$PROJECT_NAME.changes
14+
cp $ci_build_dir/*.sources $package_dir/image
15+
16+
cp -r $vm_dir/bin $package_dir/pharo/bin
17+
cp -r $vm_dir/lib $package_dir/pharo/lib
1418

15-
cp -r $vm_dir/bin $package_dir/bin
16-
cp -r $vm_dir/lib $package_dir/lib
1719
cat << EOF > $package_dir/$PROJECT_NAME
1820
#!/bin/bash
19-
./bin/pharo $PROJECT_NAME.image
21+
\`dirname "\$0"\`/pharo/bin/pharo \`dirname "\$0"\`/image/$PROJECT_NAME.image
2022
EOF
2123

2224
chmod a+rx $package_dir/$PROJECT_NAME
2325

24-
"$vm_dir/bin/pharo" --headless $package_dir/$PROJECT_NAME.image eval --save "OPVersion currentWithRunId: $RUN_ID projectName: '$REPOSITORY_NAME'"
26+
"$vm_dir/bin/pharo" --headless $package_dir/image/$PROJECT_NAME.image eval --save "OPVersion currentWithRunId: $RUN_ID projectName: '$REPOSITORY_NAME'"
2527

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

.github/scripts/build-mac.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
ci_build_dir=$SMALLTALK_CI_BUILD
6+
package_dir="$PROJECT_NAME-$PLATFORM"
7+
vm_dir=`cat $SMALLTALK_CI_VM | sed 's|\(.*\)/.*|\1|'`/pharo-vm
8+
9+
mkdir -p "$package_dir/image"
10+
11+
cp -r $vm_dir/Pharo.app/ $package_dir/Pharo.app
12+
13+
cp $ci_build_dir/TravisCI.image $package_dir/image/$PROJECT_NAME.image
14+
cp $ci_build_dir/TravisCI.changes $package_dir/image/$PROJECT_NAME.changes
15+
cp $ci_build_dir/*.sources $package_dir/image
16+
17+
cat << EOF > $package_dir/$PROJECT_NAME
18+
#!/bin/bash
19+
\`dirname "\$0"\`/Pharo.app/Contents/MacOS/Pharo \`dirname "\$0"\`/image/$PROJECT_NAME.image
20+
EOF
21+
22+
chmod a+rx $package_dir/$PROJECT_NAME
23+
24+
cat << EOF > $package_dir/README.txt
25+
26+
-- Opening OpenPonk on macOS 10 and 11 --
27+
28+
Main issue of opening OpenPonk on macOS 10 is Gatekeeper protection against executables from unverified sources.
29+
There are two options to overcome it.
30+
First option requires a little more clicking each time opening OpenPonk, but very simple first time setup,
31+
Second option requires much more steps first time opening (or after updating OP), but further opening becomes simple double click.
32+
33+
First option:
34+
First time opening (or after updating OP):
35+
1) Double click Pharo.app
36+
-> "Pharo cannot be opened because the developer cannot be verified"
37+
2) Cancel
38+
3) Right click Pharo.app
39+
4) Open
40+
-> "macOS cannot verify the developer of Pharo"
41+
5) Open
42+
-> Window with file selection opened
43+
6) Find and select file $PROJECT_NAME.image in the image folder
44+
-> "Pharo would like to access files"...
45+
7) OK
46+
-> OpenPonk should open now. If there is a window asking to receive keystrokes, you may Deny it
47+
Opening:
48+
1) Double click Pharo.app
49+
-> Window with file selection opened
50+
2) Find and select file $PROJECT_NAME.image in the image folder
51+
52+
Second option:
53+
First time opening (or after updating OP):
54+
1) Right click the $PROJECT_NAME (Unix executable)
55+
2) Open
56+
-> "macOS cannot verify the developer of $PROJECT_NAME"
57+
3) Open
58+
-> "Pharo cannot be opened because the developer cannot be verified"
59+
4) Cancel
60+
5) Open macOS System Preferences...
61+
6) Security & Privacy
62+
7) Switch to General tab (if not already there)
63+
-> There should be text about "Pharo" or "Pharo.app" being blocked and Open Anyway button next to it.
64+
8) Click on Open Anyway button
65+
-> "macOS cannot verify the developer of Pharo"
66+
9) Open
67+
-> Window with file selection opened
68+
10) Cancel
69+
11) Double click $PROJECT_NAME (Unix executable)
70+
-> "Terminal would like to access files"... That, along with next step, might be skipped if the access is already granted.
71+
12) OK
72+
-> OpenPonk should open now. If there is a window asking to receive keystrokes, you may Deny it
73+
Opening:
74+
1) Double click $PROJECT_NAME (Unix executable)
75+
EOF
76+
77+
$vm_dir/Pharo.app/Contents/MacOS/Pharo --headless $package_dir/image/$PROJECT_NAME.image eval --save "OPVersion currentWithRunId: $RUN_ID projectName: '$REPOSITORY_NAME'"
78+
79+
zip -qr $PROJECT_NAME-$PLATFORM-$VERSION.zip $package_dir

.github/scripts/build-win.ps1

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ $vm_file_content=Get-Content $ci_build_dir/vm | Out-String
1111
$vm_dir=(($vm_file_content -replace '/[^/]*$','/pharo-vm') -replace '/c/','C:\') -replace '/','\'
1212

1313
mkdir $package_dir
14+
mkdir $package_dir/image
15+
mkdir $package_dir/Pharo
1416

15-
cp $ci_build_dir/TravisCI.image $package_dir/$PROJECT_NAME.image
16-
cp $ci_build_dir/TravisCI.changes $package_dir/$PROJECT_NAME.changes
17-
cp $ci_build_dir/*.sources $package_dir
17+
cp $ci_build_dir/TravisCI.image $package_dir/image/$PROJECT_NAME.image
18+
cp $ci_build_dir/TravisCI.changes $package_dir/image/$PROJECT_NAME.changes
19+
cp $ci_build_dir/*.sources $package_dir/image
1820

19-
cp $vm_dir/*.dll $package_dir
20-
cp $vm_dir/Pharo.exe $package_dir/$PROJECT_NAME.exe
21+
cp $vm_dir/*.dll $package_dir/Pharo
22+
cp $vm_dir/Pharo.exe $package_dir/Pharo
23+
cp $vm_dir/PharoConsole.exe $package_dir/Pharo
2124

22-
& $vm_dir/PharoConsole.exe -headless $package_dir/$PROJECT_NAME.image eval --save "OPVersion currentWithRunId: $RUN_ID projectName: '$REPOSITORY_NAME'"
25+
"start %~dp0Pharo\Pharo.exe %~dp0image\$PROJECT_NAME.image" | set-content "$package_dir/$PROJECT_NAME.bat"
26+
27+
& $vm_dir/PharoConsole.exe -headless $package_dir/image/$PROJECT_NAME.image eval --save "OPVersion currentWithRunId: $RUN_ID projectName: '$REPOSITORY_NAME'"
2328

2429
Compress-Archive -Path $package_dir -DestinationPath "$PROJECT_NAME-$PLATFORM-$VERSION.zip"

.github/scripts/script.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
PharoLightTheme beCurrent.
2-
OPUmlClassEditorPlugin allDefaultProfiles.
2+
Smalltalk at: #OPUmlClassEditorPlugin ifPresent: [ :plugin | plugin allDefaultProfiles ].
33
PolymorphSystemSettings setDesktopLogoWith: OPIcons current logo asMorph.

.github/workflows/nightly.yml

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
RUN_ID: ${{ github.run_id }}
2121

2222
jobs:
23-
23+
2424
build-linux:
2525
runs-on: ubuntu-latest
2626
env:
@@ -46,6 +46,31 @@ jobs:
4646
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
4747
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
4848

49+
build-mac:
50+
runs-on: macos-latest
51+
env:
52+
PLATFORM: mac
53+
name: 'Build Mac'
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@v2.3.4
57+
- name: Load SmalltalkCI environment
58+
uses: hpi-swa/setup-smalltalkCI@1.2.1
59+
id: smalltalkci
60+
with:
61+
smalltalk-version: Pharo64-9.0
62+
- name: Prepare image and test
63+
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-version }}
64+
shell: bash
65+
timeout-minutes: 10
66+
- name: Create zip
67+
run: chmod u+x .github/scripts/build-mac.sh; ./.github/scripts/build-mac.sh
68+
- name: Cache zip
69+
uses: actions/cache@v2.1.4
70+
with:
71+
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
72+
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
73+
4974
build-win:
5075
runs-on: windows-latest
5176
env:
@@ -88,6 +113,23 @@ jobs:
88113
if: steps.get-zip.outputs.cache-hit != 'true'
89114
run: exit 1
90115

116+
check-mac-cache:
117+
needs: build-mac
118+
runs-on: macos-latest
119+
name: 'Check Mac zip is created'
120+
env:
121+
PLATFORM: mac
122+
steps:
123+
- name: Get zip from cache
124+
id: get-zip
125+
uses: actions/cache@v2.1.4
126+
with:
127+
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
128+
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
129+
- name: Fail on cache miss
130+
if: steps.get-zip.outputs.cache-hit != 'true'
131+
run: exit 1
132+
91133
check-win-cache:
92134
needs: build-win
93135
runs-on: windows-latest
@@ -106,7 +148,7 @@ jobs:
106148
run: exit 1
107149

108150
create-release:
109-
needs: [check-linux-cache, check-win-cache]
151+
needs: [check-linux-cache, check-mac-cache, check-win-cache]
110152
runs-on: ubuntu-latest
111153
name: 'Re-create release'
112154
steps:
@@ -147,6 +189,35 @@ jobs:
147189
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
148190
asset_content_type: application/zip
149191

192+
upload-mac-zip:
193+
needs: create-release
194+
runs-on: macos-latest
195+
name: 'Upload Mac zip'
196+
env:
197+
PLATFORM: mac
198+
steps:
199+
- name: Get zip from cache
200+
id: get-zip
201+
uses: actions/cache@v2.1.4
202+
with:
203+
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
204+
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
205+
- name: Get Release by Tag
206+
id: get_release_by_tag
207+
uses: jonfriesen/get-release-by-tag@v0.0.11
208+
env:
209+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
210+
with:
211+
tag_name: nightly
212+
- name: Upload zip
213+
id: upload-zip
214+
uses: actions/upload-release-asset@v1.0.2
215+
with:
216+
upload_url: ${{ steps.get_release_by_tag.outputs.upload_url }}
217+
asset_path: ./${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
218+
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
219+
asset_content_type: application/zip
220+
150221
upload-win-zip:
151222
needs: create-release
152223
runs-on: windows-latest
@@ -177,6 +248,7 @@ jobs:
177248
asset_content_type: application/zip
178249

179250
create-dependent-matrix:
251+
needs: [create-release]
180252
runs-on: ubuntu-latest
181253
name: 'Find dependent repositories'
182254
if: ${{ github.event_name == 'push' || contains(github.event.inputs.build-dependent || false, 'true') }}
@@ -193,7 +265,7 @@ jobs:
193265
run: echo "::set-output name=matrix::`cat ./.github/dependent-repositories.txt | tr -d " \t\n\r"`"
194266

195267
build-dependent:
196-
needs: [check-linux-cache, check-win-cache, create-dependent-matrix]
268+
needs: [create-dependent-matrix]
197269
runs-on: ubuntu-latest
198270
name: 'Build dependent'
199271
if: ${{ contains(needs.create-dependent-matrix.outputs.matrix, '/') }}

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,35 @@ jobs:
4141
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
4242
asset_content_type: application/zip
4343

44+
mac:
45+
runs-on: macos-latest
46+
env:
47+
PLATFORM: ${{ github.job }}
48+
name: 'Build Mac and upload zip'
49+
steps:
50+
- uses: actions/checkout@v2.3.4
51+
- uses: hpi-swa/setup-smalltalkCI@1.2.1
52+
id: smalltalkci
53+
with:
54+
smalltalk-version: Pharo64-9.0
55+
- name: Prepare image and test
56+
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-version }}
57+
shell: bash
58+
timeout-minutes: 10
59+
- name: Create zip
60+
run: chmod u+x .github/scripts/build-mac.sh; ./.github/scripts/build-mac.sh
61+
- name: Get release
62+
id: get_release
63+
uses: bruceadams/get-release@v1.2.2
64+
- name: Upload zip
65+
id: upload-zip
66+
uses: actions/upload-release-asset@v1.0.2
67+
with:
68+
upload_url: ${{ steps.get_release.outputs.upload_url }}
69+
asset_path: ./${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
70+
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip
71+
asset_content_type: application/zip
72+
4473
win:
4574
runs-on: windows-latest
4675
env:

0 commit comments

Comments
 (0)