Skip to content

Commit

Permalink
Adds support for GitHub Actions; drops support for TravisCI as well a…
Browse files Browse the repository at this point in the history
…s Squeak 5.0 and 5.1:

- Splits up prepare.sh into prepare_image.sh, test_image.sh, prepare_bundles.sh, and deploy_bundles.sh
- Extracts prepare_image_post.sh from (original) prepare_image.sh to be used during bundle creation (such as for collecting the extra Etoys project files)
- For testing, patches smalltalkCI to support GHA via gha-support.cs in test_image.st (can be removed later)
- Uses Windows platform to prepare both 32-bit and 64-bit images, and to test the images
- Uses macOS platform to create (and sign/notarize) and deploy the bundles
- All intermediate build artifacts will be uploaded during the action to remain inspectable for 90 days; this does not replace the deployment step to files.squeak.org
  • Loading branch information
marceltaeumel committed Sep 22, 2021
1 parent 173fefa commit 91abe82
Show file tree
Hide file tree
Showing 22 changed files with 763 additions and 594 deletions.
155 changes: 155 additions & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Bundle

on:
push: # All branches, but appropriate paths only.
# branches:
# - squeak-trunk
# - squeak-5.3
# - squeak-5.2
paths-ignore:
- '**.md' # Skip changes in documentation artifacts
pull_request:
branches:
- squeak-trunk
# - squeak-5.3
# - squeak-5.2
paths-ignore:
- '**.md'
schedule:
- cron: '0 0 * * *' # Build everyday at midnight
workflow_dispatch:

jobs:
prepare-image:
strategy:
fail-fast: true
matrix:
smalltalk:
- Squeak-trunk
- Squeak64-trunk
# - Squeak-5.3
# - Squeak64-5.3
# - Squeak-5.2
# - Squeak64-5.2
runs-on: windows-latest
name: 🛠 Prepare image for ${{ matrix.smalltalk }}
env:
SMALLTALK_VERSION: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2

- name: Prepare image
shell: bash
run: ./prepare_image.sh
timeout-minutes: 20

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.smalltalk }}
path: |
tmp/*.sources
tmp/*.image
tmp/*.changes
tmp/version.sh
!tmp/Test*
test-image:
needs: [prepare-image]
strategy:
fail-fast: true
matrix:
smalltalk:
- Squeak-trunk
- Squeak64-trunk
# - Squeak-5.3
# - Squeak64-5.3
# - Squeak-5.2
# - Squeak64-5.2
runs-on: windows-latest
name: 🧪 Test image of ${{ matrix.smalltalk }}
env:
SMALLTALK_VERSION: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2

- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ${{ matrix.smalltalk }}
path: tmp

- name: "Set up SmalltalkCI"
# uses: hpi-swa/setup-smalltalkCI@v1
uses: marceltaeumel/setup-smalltalkCI@marceltaeumel/install-path
with:
smalltalk-image: ${{ matrix.smalltalk }}
smalltalkCI-workspace: ${{ github.workspace }}

- name: "Run tests"
continue-on-error: true
shell: bash
run: ./test_image.sh
timeout-minutes: 20

- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.smalltalk }}-tests
path: tmp/*.xml


prepare-bundles:
needs: [prepare-image]
strategy:
fail-fast: true
matrix:
smalltalk:
- Squeak-trunk
- Squeak64-trunk
# - Squeak-5.3
# - Squeak64-5.3
# - Squeak-5.2
# - Squeak64-5.2
runs-on: macos-latest
name: 📦 Prepare bundles for ${{ matrix.smalltalk }}
env:
SMALLTALK_VERSION: ${{ matrix.smalltalk }}
GIT_BRANCH: ${{ github.ref }}
DEPLOYMENT_BRANCH: squeak-trunk

ENCRYPTED_KEY: ${{ secrets.ENCRYPTED_KEY }}
ENCRYPTED_IV: ${{ secrets.ENCRYPTED_IV }}
PUBLIC_KEY: ${{ secrets.PUBLIC_KEY }}

PROXY_PORT: ${{ secrets.PROXY_PORT }}
PROXY_HOST: ${{ secrets.PROXY_HOST }}
PROXY_USER: ${{ secrets.PROXY_USER }}
UPSTREAM_HOST: ${{ secrets.UPSTREAM_HOST }}
UPSTREAM_USER: ${{ secrets.UPSTREAM_USER }}

CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
SIGN_IDENTITY: ${{ secrets.SIGN_IDENTITY }}
NOTARIZATION_USER: ${{ secrets.NOTARIZATION_USER }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}

steps:
- uses: actions/checkout@v2

- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ${{ matrix.smalltalk }}
path: tmp

- run: ./prepare_bundles.sh

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.smalltalk }}-bundles
path: product/*

- run: ./deploy_bundles.sh
if: endsWith(github.ref, env.DEPLOYMENT_BRANCH)
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# The Squeak/Smalltalk Programming System

[![Build Status](https://travis-ci.com/squeak-smalltalk/squeak-app.svg?branch=squeak-trunk)](https://travis-ci.com/squeak-smalltalk/squeak-app)

This is the code repository for Squeak's build system.

A build works basically as follows. The [prepare.sh](prepare.sh) script downloads VMs from http://files.squeak.org/base/ and then invokes the following scripts:

* [prepare_image.sh](prepare_image.sh) downloads a base image/changes/sources from http://files.squeak.org/base/
* [prepare_image.st](prepare_image.st) updates the image and creates a `version.sh` file with the version information
* [prepare_aio.sh](prepare_aio.sh) builds the All-In-One
* [prepare_mac.sh](prepare_mac.sh) builds the Mac release
* [prepare_win.sh](prepare_win.sh) builds the Windows release
* [prepare_lin.sh](prepare_lin.sh) builds the Linux x86 release
* [prepare_armv6.sh](prepare_armv6.sh) builds the Linux ARM release

Finally, [prepare.sh](prepare.sh) uploads everything to http://files.squeak.org/
(e.g. bleeding-edge trunk builds go to http://files.squeak.org/trunk).
# The Squeak/Smalltalk Programming System

[![Build Status](https://github.com/squeak-smalltalk/squeak-app/actions/workflows/bundle.yml/badge.svg)](https://github.com/squeak-smalltalk/squeak-app/actions/workflows/bundle.yml)

This is the code repository for Squeak's build system.

A build works basically as follows. First, 32-bit and 64-bit images are prepared and tested:

* [prepare_image.sh](prepare_image.sh) downloads a base image/changes/sources from http://files.squeak.org/base/
* [prepare_image.st](prepare_image.st) updates the image and creates a `version.sh` file with the version information
* [test_image.sh](test_image.sh) uses [smalltalkCI](https://github.com/hpi-swa/smalltalkCI) to run all tests and document the results

Second, the [prepare-bundles.sh](prepare-bundles.sh) script downloads VMs from http://files.squeak.org/base/ and then creates the bundles through the following scripts:

* [prepare_aio.sh](prepare_aio.sh) builds the All-In-One
* [prepare_mac.sh](prepare_mac.sh) builds the Mac release
* [prepare_win.sh](prepare_win.sh) builds the Windows release
* [prepare_lin.sh](prepare_lin.sh) builds the Linux x86 release
* [prepare_armv6.sh](prepare_armv6.sh) builds the Linux ARM release

Finally, [deploy_bundles.sh](deploy_bundles.sh) uploads everything to http://files.squeak.org/
(e.g., bleeding-edge trunk builds go to http://files.squeak.org/trunk).
58 changes: 58 additions & 0 deletions deploy_bundles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
################################################################################
# PROJECT: Squeak Bundle Generation
# FILE: deploy_bundles.sh
# CONTENT: Upload all bundles to files.squeak.org
#
# AUTHORS: Fabio Niephaus, Hasso Plattner Institute, Potsdam, Germany
# Marcel Taeumel, Hasso Plattner Institute, Potsdam, Germany
################################################################################

set -o errexit

[[ -z "${ENCRYPTED_DIR}" ]] && exit 4
[[ -z "${PRODUCT_DIR}" ]] && exit 5

source env_vars

readonly TARGET_BASE="/var/www/files.squeak.org"

begin_group "...uploading all files to files.squeak.org.."

if ! is_dir "${ENCRYPTED_DIR}"; then
echo "Failed to locate decrypted files."
exit 1
fi

if is_etoys; then
TARGET_PATH="${TARGET_BASE}/etoys/${SQUEAK_VERSION/Etoys/}"
else
TARGET_PATH="${TARGET_BASE}/${SQUEAK_VERSION/Squeak/}"
fi
TARGET_PATH="${TARGET_PATH}/${IMAGE_NAME}"

chmod 600 "${ENCRYPTED_DIR}/ssh_deploy_key"
ssh-keyscan -t ecdsa-sha2-nistp256 -p "${PROXY_PORT}" "${PROXY_HOST}" 2>&1 | tee -a "${HOME}/.ssh/known_hosts" > /dev/null;
echo "${UPSTREAM_HOST} ecdsa-sha2-nistp256 ${PUBLIC_KEY}" | tee -a "${HOME}/.ssh/known_hosts" > /dev/null;
rsync -rvz --ignore-existing -e "ssh -o ProxyCommand='ssh -l ${PROXY_USER} -i ${ENCRYPTED_DIR}/ssh_deploy_key -p ${PROXY_PORT} -W %h:%p ${PROXY_HOST}' -l ${UPSTREAM_USER} -i ${ENCRYPTED_DIR}/ssh_deploy_key" "${PRODUCT_DIR}/" "${UPSTREAM_HOST}:${TARGET_PATH}/";

end_group

begin_group "...updating latest symlinks on server..."

LATEST_PREFIX="${TARGET_BASE}/nightly/Squeak-latest-${IMAGE_BITS}bit"
SYMS_CMD="ln -f -s ${TARGET_PATH}/${IMAGE_NAME}.zip ${LATEST_PREFIX}.zip"
SYMS_CMD="${SYMS_CMD} && ln -f -s ${TARGET_PATH}/${BUNDLE_NAME_LIN}.zip ${LATEST_PREFIX}-Linux.zip"
SYMS_CMD="${SYMS_CMD} && ln -f -s ${TARGET_PATH}/${BUNDLE_NAME_MAC}.dmg ${LATEST_PREFIX}-macOS.dmg"
SYMS_CMD="${SYMS_CMD} && ln -f -s ${TARGET_PATH}/${BUNDLE_NAME_WIN}.zip ${LATEST_PREFIX}-Windows.zip"
if is_32bit; then
SYMS_CMD="${SYMS_CMD} && ln -f -s ${TARGET_PATH}/${BUNDLE_NAME_ARM}.zip ${LATEST_PREFIX}-ARMv6.zip"
fi
ssh -o ProxyCommand="ssh -l ${PROXY_USER} -i ${ENCRYPTED_DIR}/ssh_deploy_key -p ${PROXY_PORT} -W %h:%p ${PROXY_HOST}" \
-l "${UPSTREAM_USER}" -i "${ENCRYPTED_DIR}/ssh_deploy_key" "${UPSTREAM_HOST}" -t "${SYMS_CMD}"

end_group

# Remove sensitive information
rm -rf "${ENCRYPTED_DIR}"
security delete-keychain "${KEY_CHAIN}"
14 changes: 14 additions & 0 deletions env_vars
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
readonly HOME_DIR="$(pwd)"
readonly TMP_DIR="${HOME_DIR}/tmp"

readonly FILES_BASE="http://files.squeak.org/base"
readonly RELEASE_URL="${FILES_BASE}/${SMALLTALK_VERSION/Etoys/Squeak}"
readonly IMAGE_URL="${RELEASE_URL}/base.zip"

readonly VM_BASE="${RELEASE_URL}"

# version.sh file produced by image
readonly VERSION_FILE="${TMP_DIR}/version.sh"

readonly ICONS_DIR="${HOME_DIR}/icons"
readonly RELEASE_NOTES_DIR="${HOME_DIR}/release-notes"
Loading

0 comments on commit 91abe82

Please sign in to comment.