Skip to content

Packages totalcross #159

Packages totalcross

Packages totalcross #159

Workflow file for this run

name: Packages `totalcross`
on:
workflow_dispatch:
schedule:
- cron: "0 1 * * 1"
jobs:
build_linux:
name: Build '${{ matrix.project }}'
strategy:
fail-fast: false
matrix:
project: [ linux-amd64, linux-arm32v7, linux-arm64 ]
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Allow multiarch
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build VM & Launcher
run: |
mkdir -p build
docker run -v ${PWD}/build:/build -v ${PWD}:/sources -t totalcross/${{ matrix.project }}:v1.0.0 bash -c "cmake /sources/TotalCrossVM -DCMAKE_BUILD_TYPE=Release -G Ninja && ninja"
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.project }}
path: build
build_sdk_android:
name: Build SDK and Android
if: ${{ always() }}
needs: build_linux
runs-on: ubuntu-18.04
container:
image: docker://fabernovel/android:api-29-ndk-v1.2.0
steps:
- name: Checkout
uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Download Dependences S3 Libs
uses: prewk/s3-cp-action@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE: 's3://${{ secrets.S3_BUCKET }}/libs.zip'
DEST: 'libs.zip'
- name: Download Dependences S3 Tools
uses: prewk/s3-cp-action@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE: 's3://${{ secrets.S3_BUCKET }}/tools.zip'
DEST: 'tools.zip'
- name: Download Dependences S3 LitebaseLib.tcz
uses: prewk/s3-cp-action@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE: 's3://${{ secrets.S3_BUCKET }}/LitebaseLib.tcz'
DEST: 'LitebaseLib.tcz'
- name: Download Dependences S3 Android Key
uses: prewk/s3-cp-action@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE: 's3://${{ secrets.S3_BUCKET }}/key_android.zip'
DEST: 'key_android.zip'
- name: Download Dependences S3 Docs Litebase
uses: prewk/s3-cp-action@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE: 's3://${{ secrets.S3_BUCKET }}/docs_litebase.zip'
DEST: 'docs_litebase.zip'
- name: Download Dependences S3 Sources Litebase
uses: prewk/s3-cp-action@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE: 's3://${{ secrets.S3_BUCKET }}/lb.zip'
DEST: 'lb.zip'
- name: Build SDK
working-directory: TotalCrossSDK
run: |
./gradlew dist -x test --stacktrace
cp build/libs/totalcross-sdk-* dist
- name: Build Android
working-directory: TotalCrossVM/android
run: |
./gradlew assembleRelease -x test --stacktrace
- name: Download Linux amd64
continue-on-error: true
uses: actions/download-artifact@v2
with:
name: linux-amd64
path: linux-amd64
- name: Manage Linux amd64 files
if: ${{ success() }}
run: |
mkdir -p TotalCrossSDK/dist/vm/linux
mkdir -p TotalCrossSDK/etc/launchers/linux
cp -p -a -R linux-amd64/libtcvm.so TotalCrossSDK/dist/vm/linux/
cp -p -a -R linux-amd64/Launcher TotalCrossSDK/etc/launchers/linux/
- name: Download Linux arm32
continue-on-error: true
uses: actions/download-artifact@v2
with:
name: linux-arm32v7
path: linux-arm32v7
- name: Manage Linux arm32 files
if: ${{ success() }}
run: |
mkdir -p TotalCrossSDK/dist/vm/linux_arm
mkdir -p TotalCrossSDK/etc/launchers/linux_arm
cp -p -a -R linux-arm32v7/libtcvm.so TotalCrossSDK/dist/vm/linux_arm/
cp -p -a -R linux-arm32v7/Launcher TotalCrossSDK/etc/launchers/linux_arm/
- name: Download Linux arm64
continue-on-error: true
uses: actions/download-artifact@v2
with:
name: linux-arm64
path: linux-arm64
- name: Manage Linux arm64 files
if: ${{ success() }}
run: |
mkdir -p TotalCrossSDK/dist/vm/linux_arm64
mkdir -p TotalCrossSDK/etc/launchers/linux_arm64
cp -p -a -R linux-arm64/libtcvm.so TotalCrossSDK/dist/vm/linux_arm64/
cp -p -a -R linux-arm64/Launcher TotalCrossSDK/etc/launchers/linux_arm64/
- name: Manager files
run: |
rm -rf TotalCrossSDK/docs/* && mv TotalCrossSDK/build/docs/javadoc TotalCrossSDK/docs/html
mv LitebaseLib.tcz TotalCrossSDK/dist/vm/
find TotalCrossSDK -name .DS_Store -exec rm -rf -- {} +
find TotalCrossSDK -name "*git*" -exec rm -rf -- {} +
find TotalCrossSDK -name "*gradle*" -type f -exec rm -rf -- {} + && find TotalCrossSDK -name "*gradle*" -type d -exec rm -rf -- {} +
rm -rf TotalCrossSDK/build TotalCrossSDK/build.xml TotalCrossSDK/proguard.txt TotalCrossSDK/src/test
unzip -n libs.zip -x "__MACOSX/*" -d TotalCrossSDK/etc/
unzip -n tools.zip -x "__MACOSX/*" -d TotalCrossSDK/etc/
unzip -n key_android.zip -d TotalCrossSDK/etc/
unzip -n lb.zip -d TotalCrossSDK/src/
unzip -n docs_litebase.zip -d TotalCrossSDK/docs/html
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: TotalCross
path: |
TotalCrossSDK/