Skip to content

Merge pull request #25 from Echtzeitsysteme/hotfix/ci-macos-arm-job-name #188

Merge pull request #25 from Echtzeitsysteme/hotfix/ci-macos-arm-job-name

Merge pull request #25 from Echtzeitsysteme/hotfix/ci-macos-arm-job-name #188

Workflow file for this run

name: Build Eclipse GIPS
on:
push:
# Run pipeline for commits on branch 'main' and on 'testing/<stuff>'
branches:
- main
- 'testing/**'
- 'feature/**'
- 'hotfix/**'
# Run pipeline for release tags
tags:
- 'v*.*.*'
schedule:
# Weekly builds on Monday morning 4:42
# Github doc:
# "The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs.
# High load times include the start of every hour.
# To decrease the chance of delay, schedule your workflow to run at a different time of the hour."
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '42 4 * * 1'
env:
# Eclipse version to use in this CI
VERSION: "2024-09"
# emoflon-headless source URL (needed by macOS-based runner workaround)
EMOFLON_HEADLESS_SRC: "https://api.github.com/repos/eMoflon/emoflon-headless/releases/latest"
# import plugin URL
IMPORT_PLUGIN_SRC: "https://api.github.com/repos/maxkratz/eclipse-import-projects-plugin/releases/latest"
jobs:
# Get emoflon-headless updatesite release + eclipse import plugin artifacts
# This is necessary because some of the Github-hosted macOS-based runner
# did trigger the API rate limit from time to time.
collect-github-api-artifacts:
runs-on: [ubuntu-20.04]
steps:
- name: Find emoflon-headless updatesite
run: |
RESPONSE=$(curl -s $EMOFLON_HEADLESS_SRC)
echo "curl: $RESPONSE"
EMOFLON_HEADLESS_LATEST_UPDATESITE=$(echo "$RESPONSE" \
| grep "updatesite.*zip" \
| cut -d : -f 2,3 \
| tr -d \")
if [[ -z "${EMOFLON_HEADLESS_LATEST_UPDATESITE// }" ]]; then
log "This runner propably reached it's Github API rate limit. Exit."
exit 1
fi
wget -qi $EMOFLON_HEADLESS_LATEST_UPDATESITE
mv updatesite.zip emoflon-headless-updatesite.zip
- name: Find eclipse import plugin jar
run: |
RESPONSE=$(curl -s $IMPORT_PLUGIN_SRC)
echo "curl: $RESPONSE"
IMPORT_PLUGIN_LATEST_SRC=$(echo "$RESPONSE" \
| grep "/com.seeq.eclipse.importprojects*.*jar" \
| cut -d : -f 2,3 \
| tr -d \")
if [[ -z "${IMPORT_PLUGIN_LATEST_SRC// }" ]]; then
echo "This runner propably reached it's Github API rate limit. Exit."
exit 1
fi
echo "Found URL: $IMPORT_PLUGIN_LATEST_SRC"
wget "${IMPORT_PLUGIN_LATEST_SRC// }"
mv com.seeq.eclipse.importprojects*.jar com.seeq.eclipse.importprojects.jar
- name: Upload emoflon-headless updatesite artifact
uses: actions/upload-artifact@v4
with:
name: emoflon-headless-updatesite.zip
path: emoflon-headless-updatesite.zip
- name: Upload eclipse import plugin artifact
uses: actions/upload-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
path: com.seeq.eclipse.importprojects.jar
# Create splash image
create-splash-image:
runs-on: [ubuntu-20.04]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Start message
run: echo "Creating splash image for version $VERSION."
- name: Run splash creator script
run: chmod +x splash.sh && ./splash.sh img $VERSION null
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: splash.bmp
path: splash.bmp
# Build Eclipse GIPS Linux user
build-linux-user:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [ubuntu-20.04]
steps:
- name: Start message
run: echo "Started CI build (Eclipse GIPS Linux user)."
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: |
chmod +x build.sh && ./build.sh -m user -o linux
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-gips-linux-user
path: eclipse-gips-linux-user.zip
# Build Eclipse GIPS Linux user CI
build-linux-user-ci:
needs: [collect-github-api-artifacts]
runs-on: [ubuntu-20.04]
steps:
- name: Start message
run: echo "Started CI build (Eclipse GIPS Linux user CI)."
- name: Check out repository code
uses: actions/checkout@v4
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m user -o linux --skip-theme
- name: Rename ZIP archive
run: mv eclipse-gips-linux-user.zip eclipse-gips-linux-user-ci.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-gips-linux-user-ci
path: eclipse-gips-linux-user-ci.zip
# Build Eclipse GIPS macOS user
build-macos-user:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [macos-14]
steps:
- name: Start message
run: echo "Started CI build (Eclipse GIPS macOS user)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m user -o macos
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-gips-macos-user
path: eclipse-gips-macos-user.zip
# Build Eclipse GIPS macOS ARM user
build-macos-arm-user:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [macos-14]
steps:
- name: Start message
run: echo "Started CI build (Eclipse GIPS macOS user)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m user -o macosarm
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-gips-macos-arm-user
path: eclipse-gips-macos-arm-user.zip
# Build Eclipse GIPS Windows user
build-windows-user:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [windows-2022]
steps:
- name: Start message
run: echo "Started CI build (Eclipse GIPS Windows user)."
- name: Install dependencies
run: |
choco install wget curl unzip zip --no-progress
- name: Install correct Java version
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '16'
- name: Fix Git line endings
run: git config --global core.autocrlf input
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: |
bash ./build.sh -m user -o windows
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-gips-windows-user
path: eclipse-gips-windows-user.zip
# Create a release if running on tag
create-release:
needs: [build-linux-user, build-linux-user-ci, build-macos-user, build-macos-arm-user, build-windows-user]
runs-on: [ubuntu-20.04]
# Only run on pushed tags (and explicitely ignore scheduled runs)
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && github.event_name != 'schedule'
steps:
- name: Collect artifacts
uses: actions/download-artifact@master
- name: Release eclipse-gips-linux
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-gips-linux-user/eclipse-gips-linux-user.zip
- name: Release eclipse-gips-macos
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-gips-macos-user/eclipse-gips-macos-user.zip
- name: Release eclipse-gips-macos-arm
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-gips-macos-arm-user/eclipse-gips-macos-arm-user.zip
- name: Release eclipse-gips-linux-ci
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-gips-linux-user-ci/eclipse-gips-linux-user-ci.zip
- name: Release eclipse-gips-windows
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-gips-windows-user/eclipse-gips-windows-user.zip