Skip to content

Build Maven Cache

Build Maven Cache #12

name: Build Maven Cache
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 6'
jobs:
build:
name: build maven cache
runs-on: ubuntu-latest
if: github.repository == 'opencast/opencast'
steps:
- uses: actions/checkout@v4
- name: setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: clone mvn.opencast.org
run: |
git clone --depth 1 https://github.com/opencast/mvn.opencast.org.git
- name: prepare additional maven repository
run: |
sed -i "s#https://mvn.opencast.org/#file://$(readlink -f mvn.opencast.org)#" pom.xml
- name: install dependencies
run: |
sudo apt update -q
sudo apt install -y -q \
bzip2 \
ffmpeg \
gzip \
s3cmd \
sox \
tar \
unzip
- name: prepare build
run: |
sed -i 's/build --skipTests=${skipTests}/build --skipTests=true/' modules/admin-ui-frontend/pom.xml
- name: build opencast
run: |
mvn clean install -Pdev \
--batch-mode \
-Dsurefire.rerunFailingTestsCount=2 \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dhttp.keepAlive=false \
-Dmaven.wagon.http.pool=false \
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
- name: remove opencast assets
run: |
rm -rf ~/.m2/repository/org/opencastproject/{base,assemblies}/
rm -rf ~/.m2/repository/org/opencastproject/opencast-*
- name: build cache tarball
run: |
ln -s ~/.m2
tar cfvJh dot-m2.tar.xz .m2
- name: configure s3cmd
uses: lkiesow/configure-s3cmd@v1
with:
host: ${{ secrets.S3_HOST }}
access_key: ${{ secrets.S3_ACCESS_KEY }}
secret_key: ${{ secrets.S3_SECRET_KEY }}
- name: upload assets
run: |
s3cmd put -P dot-m2.tar.xz s3://opencast-maven-cache/