Skip to content
Draft
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
56 changes: 56 additions & 0 deletions .github/workflows/generate_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Generate Release

on:
workflow_dispatch:

jobs:
generate-release:
runs-on: ubuntu-latest
env:
Output_Dir: ${{ github.workspace }}/out
Version: snapshot

steps:
- name: Checkout Ecdar/ECDAR Sources
uses: actions/checkout@v3

- name: Checkout Ecdar/Ecdar-GUI Sources
uses: actions/checkout@v3
with:
name: Ecdar/Ecdar-GUI
path: Ecdar-GUI
submodules: recursive

- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Download j-Ecdar
uses: robinraju/release-downloader@v1.7
with:
repository: "Ecdar/j-Ecdar"
latest: true
fileName: "j-Ecdar*"
out-file-path: "Ecdar-GUI/lib/"

- name: Download Reveaal
uses: robinraju/release-downloader@v1.7
with:
repository: "Ecdar/Reveaal"
latest: true
fileName: "Reveaal*"
out-file-path: "Ecdar-GUI/lib/"

- name: Generate Distributions
run: |
cd ${{ github.workspace }}/Ecdar-GUI
./${{ github.workspace }}/*.sh -v $Version -o $Output_Dir

- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: $Version
path: $Output_Dir
22 changes: 19 additions & 3 deletions generate_distributable.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
#!/bin/bash

read -p "The version of this release: " version
while getopts v:o: flag
do
case "${flag}" in
v) version=${OPTARG};;
o) output_dir=${OPTARG};;
esac
done

if [ $version="" ]; then
version="snapshot"
fi

if [ $output_dir="" ]; then
output_dir="${HOME}/Documents"
fi

target_name="ecdar-${version}"
version_file="src/main/resources/ecdar/version"

echo "Generating platform specific distributions of ${target_name} in ${output_dir}"

if [ -f $version_file ]; then
echo "version: ${version}" > $version_file
else
Expand All @@ -14,7 +30,7 @@ fi

# Generate distributable zip file with specified version
./gradlew clean # Clean build directory to prevent multiple .zip files from interfering with script
./gradlew -PecdarVersion=${version} distZip
./gradlew -PecdarVersion=$version distZip

# Create temporary directory
TEMPD=$(mktemp -d)
Expand Down Expand Up @@ -62,6 +78,6 @@ chmod u+x $TEMPD/*/lib/Reveaal
chmod u+x $TEMPD/*/lib/Reveaal.exe

# Clear target directory and copy the contents of the temporary directory to target
dest="${HOME}/Documents/${target_name}"
dest="$output_dir/${target_name}"
rm -r $dest &>/dev/null; mkdir $dest
cp -r $TEMPD/*/* $dest