Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for GitHub Actions #22

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .encrypted.zip.enc
Binary file not shown.
178 changes: 178 additions & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
name: Bundle

on:
push: # Choose the branch that matches the Smalltalk version below
branches:
- squeak-trunk
# - squeak-5.3
# - squeak-5.2
paths-ignore:
- '**.md' # Skip changes in documentation artifacts
pull_request: # Choose the branch that matches the Smalltalk version below
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
# - Etoys-trunk
# - Etoys64-trunk
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

- name: Export global environment
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.smalltalk }}-env
path: tmp/global-env


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
# - Etoys-trunk
# - Etoys64-trunk
runs-on: windows-latest
name: 🧪 Test image of ${{ matrix.smalltalk }}
env:
SMALLTALK_VERSION: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2

- name: Import global environment
uses: actions/download-artifact@v2
with:
name: ${{ matrix.smalltalk }}-env
path: tmp

- 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 # smalltalkCI test results


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
# - Etoys-trunk
# - Etoys64-trunk
runs-on: macos-10.15 # fixed for xcnotary
name: 📦 Prepare bundles for ${{ matrix.smalltalk }}
env:
SMALLTALK_VERSION: ${{ matrix.smalltalk }}
SHOULD_DEPLOY: ${{ endsWith(github.ref, 'squeak-trunk') }}
SHOULD_CODESIGN: ${{ endsWith(github.ref, 'squeak-trunk') }}

steps:
- uses: actions/checkout@v2

- name: Import global environment
uses: actions/download-artifact@v2
with:
name: ${{ matrix.smalltalk }}-env
path: tmp

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

- run: ./prepare_bundles.sh
env:
CODESIGN_KEY: ${{ secrets.CODESIGN_KEY }}
CODESIGN_IV: ${{ secrets.CODESIGN_IV }}
CERT_IDENTITY: ${{ secrets.CERT_IDENTITY }}
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
NOTARIZATION_USER: ${{ secrets.NOTARIZATION_USER }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}

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

- run: ./deploy_bundles.sh
if: env.SHOULD_DEPLOY == 'true'
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_IV: ${{ secrets.DEPLOY_IV }}
SSH_PUBLIC_KEY: ${{ secrets.SSH_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 }}
18 changes: 11 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
*.sources
*.changes
*.image
*.p12
*.cer
encrypted/
.encrypted.zip
*.sources
*.changes
*.image
*.p12
*.cer
secret*/
.secret-*.zip
smalltalk-ci/repository/**
tmp/**
build/**
product/**
Binary file added .secret-codesign.zip.enc
Binary file not shown.
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).
97 changes: 97 additions & 0 deletions deploy_bundles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
################################################################################
# PROJECT: Squeak Bundle Generation
# FILE: deploy_bundles.sh
# CONTENT: Upload all bundles to files.squeak.org
#
# REQUIRES:
# SMALLTALK_VERSION ... e.g., Squeak64-trunk
# SHOULD_DEPLOY ... i.e., true or false
# product/*.zip
# product/*.dmg
# IMAGE_NAME
# IMAGE_BITS
#....BUNDLE_NAME_LIN
#....BUNDLE_NAME_MAC
#....BUNDLE_NAME_WIN
#....BUNDLE_NAME_ARM ... only on 32-bit
# DEPLOY_KEY ... i.e., for unlocking secret files
# DEPLOY_IV ... i.e., for unlocking secret files
# SSH_PUBLIC_KEY
# PROXY_PORT
# PROXY_HOST
# PROXY_USER
# UPSTREAM_HOST
# UPSTREAM_USER
# PROVIDES:
# -
#
# AUTHORS: Fabio Niephaus, Hasso Plattner Institute, Potsdam, Germany
# Marcel Taeumel, Hasso Plattner Institute, Potsdam, Germany
################################################################################

set -o errexit

source "env_vars"
source "helpers.sh"

[[ -z "${IMAGE_NAME}" ]] && exit 2
[[ -z "${IMAGE_BITS}" ]] && exit 3

[[ -z "${BUNDLE_NAME_LIN}" ]] && exit 4
[[ -z "${BUNDLE_NAME_MAC}" ]] && exit 5
[[ -z "${BUNDLE_NAME_WIN}" ]] && exit 6

if is_32bit; then
[[ -z "${BUNDLE_NAME_ARM}" ]] && exit 7
fi

begin_group "...preparing deployment..."

if [[ -z "${DEPLOY_KEY}" ]]; then
print_error "Cannot deploy because secret missing."
exit 1
else
unlock_secret "deploy" "${DEPLOY_KEY}" "${DEPLOY_IV}"
readonly SSH_KEY_FILEPATH="${HOME_PATH}/secret-deploy/ssh_deploy_key"
readonly SSH_KEY_PATH="${HOME_PATH}/secret-deploy"
chmod 600 "${SSH_KEY_FILEPATH}"
fi

end_group

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

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

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


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 ${SSH_PUBLIC_KEY}" | tee -a "${HOME}/.ssh/known_hosts" > /dev/null;
rsync -rvz --ignore-existing -e "ssh -o ProxyCommand='ssh -l ${PROXY_USER} -i ${SSH_KEY_FILEPATH} -p ${PROXY_PORT} -W %h:%p ${PROXY_HOST}' -l ${UPSTREAM_USER} -i ${SSH_KEY_FILEPATH}" "${PRODUCT_PATH}/" "${UPSTREAM_HOST}:${UPSTREAM_PATH}/";

end_group

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

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

end_group

# Remove sensitive information
rm -rf "${SSH_KEY_PATH}"
15 changes: 15 additions & 0 deletions env_vars
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
readonly HOME_PATH="$(pwd)"

readonly FILES_BASE="http://files.squeak.org/base"
readonly RELEASE_URL="${FILES_BASE}/${SMALLTALK_VERSION/Etoys/Squeak}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there an Etoys?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still support for building Etoys bundles. See http://files.squeak.org/etoys/ . It uses the same base files from files.squeak.org/base. So, you have to replace "Etoys" with "Squeak" when building for "Etoys-trunk" or "Etoys64-trunk".


readonly IMAGE_URL="${RELEASE_URL}/base.zip"
readonly VM_BASE="${RELEASE_URL}"

readonly VM_LIN="vm-linux"
readonly VM_MAC="vm-macos"
readonly VM_WIN="vm-win"
readonly VM_ARM6="vm-armv6"

readonly ICONS_PATH="${HOME_PATH}/icons"
readonly RELEASE_NOTES_PATH="${HOME_PATH}/release-notes"
Loading