Skip to content

Commit

Permalink
workflow debug 20
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Oct 6, 2023
1 parent d1f141d commit 3469c93
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .github/scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ pharo-ui \`dirname "\$0"\`/image/$PROJECT_NAME.image
EOF

cat << EOF > $package_dir/README.txt
To run OpenPonk on Debian-based and Ubuntu-based Linux distros, simply use $PROJECT_NAME executable.
To run OpenPonk on Debian-based, Ubuntu-based and possibly other Linux distros, simply use $PROJECT_NAME executable.
-- ArchLinux, Fedora and OpenSUSE installation --
ArchLinux, Fedora and OpenSUSE require installation of Pharo programming language (sudo privileges needed).
-- In case of errors/exceptions --
OpenPonk might encounter some error when used with some Linux distros. In that case, installation of Pharo programming language is required (sudo privileges needed).
1. Open Pharo builds website: https://software.opensuse.org/download.html?project=devel:languages:pharo:latest&package=pharo9-ui
1. Open Pharo builds website: https://software.opensuse.org//download.html?project=devel:languages:pharo:stable&package=pharo-ui
2. Select your Linux distribution.
3. Select "Add repository and install manually".
4. Follow shown instruction if any and execute shown bash code in terminal - one line at a time.
You might need to prepend "sudo" before each line.
If your distro version number does not match given options, try manually changing the version number in shown code.
If your distro version number does not match given options, try manually changing the version number/name in shown code.
After Pharo is installed, you may run OpenPonk using $PROJECT_NAME-pharo-ui executable.
EOF

chmod a+rx $package_dir/$PROJECT_NAME $package_dir/$PROJECT_NAME-pharo-ui

"$vm_dir/bin/pharo" --headless $package_dir/image/$PROJECT_NAME.image eval --save "OPVersion currentWithRunId: $RUN_ID projectName: '$REPOSITORY_NAME'"
"$vm_dir/bin/pharo" --headless $package_dir/image/$PROJECT_NAME.image eval --save "PharoCommandLineHandler forcePreferencesOmission: true. OPVersion currentWithRunId: $RUN_ID projectName: '$REPOSITORY_NAME'"

zip -qr $PROJECT_NAME-$PLATFORM-$VERSION.zip $package_dir
4 changes: 2 additions & 2 deletions .github/scripts/build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ chmod a+rx $package_dir/$PROJECT_NAME

cat << EOF > $package_dir/README.txt
-- Opening OpenPonk on macOS 10 and 11 --
-- Opening OpenPonk on macOS 10+ --
Main issue of opening OpenPonk on macOS 10 is Gatekeeper protection against executables from unverified sources.
Main issue of opening OpenPonk on macOS 10+ is Gatekeeper protection against executables from unverified sources.
There are two options to overcome it.
First option requires a little more clicking each time opening OpenPonk, but very simple first time setup,
Second option requires much more steps first time opening (or after updating OP), but further opening becomes simple double click.
Expand Down
15 changes: 0 additions & 15 deletions .github/scripts/save-stats.ps1

This file was deleted.

69 changes: 68 additions & 1 deletion .github/scripts/save-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,72 @@ mkdir $package_dir
unzip -q $PROJECT_NAME-$PLATFORM-$VERSION.zip

"$package_dir/pharo/bin/pharo" --headless $package_dir/image/$PROJECT_NAME.image eval "
NonInteractiveTranscript stderr show: 'test'
| getResponse getContents downloads text timestamp filename putResponse |
PharoCommandLineHandler forcePreferencesOmission: false.
getResponse := ZnClient new
url:
'https://api.github.com/repos/openponk/$REPOSITORY_NAME/releases/tags/nightly';
accept: ZnMimeType applicationJson;
setBearerAuthentication: '$GITHUB_TOKEN';
get;
response.
getContents := STONJSON fromString: getResponse entity contents.
(getResponse status >= 300 or: [
(getContents includesKey: #assets) not ]) ifTrue: [
self error: (String streamContents: [ :s |
s << 'Get response status ' << getResponse status asString << '.'.
getResponse status == 404 ifTrue: [
s
<<
' If this is the first build of this repository, manually create pre-release named "nightly" first and create branch named dls (possibly with no files). This is whole body of response: '
<< getResponse entity contents ] ]) ].
downloads := (getContents at: #assets) sumNumbers: [ :each |
each at: #download_count ].
downloads isZero ifTrue: [
^ 'No downloads of last nightly build - nothing to upload' ].
text := String streamContents: [ :s |
s << 'name,created_at,download_count'.
s lf.
(getContents at: #assets) do: [ :each |
s << (each at: #name) asString << ','
<< (each at: #created_at) asString << ','
<< (each at: #download_count) asString.
s lf ] ].
timestamp := DateAndTime now asString.
filename := ((timestamp first: 19) copyReplaceAll: ':' with: '')
, '.csv'.
putResponse := ZnClient new
url:
'https://api.github.com/repos/openponk/$REPOSITORY_NAME/contents/'
, filename;
accept: ZnMimeType applicationJson;
setBearerAuthentication: '$GITHUB_TOKEN';
entity: (ZnEntity
with: '{
\"content\":\"' , text asByteArray base64Encoded , '\",
\"message\":\"' , timestamp , '\",
\"branch\":\"dls\"
}'
type: ZnMimeType applicationJson);
put;
response.
(putResponse status >= 300) ifTrue: [
self error: (String streamContents: [ :s |
s << 'Put response status ' << putResponse status asString << '.'.
putResponse status == 404 ifTrue: [
s
<<
' If this is the first build of this repository, manually create branch named dls (possibly with no files). This is whole body of response: '
<< putResponse entity contents ] ]) ].
^ 'Uploaded ' , downloads asString , ' download count'
"

0 comments on commit 3469c93

Please sign in to comment.