Update to Opencast 13.12 #135
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build RPMs | |
on: | |
push: | |
branches: | |
- 'r/*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
osversion: | |
- el7 | |
- el8 | |
- el9 | |
name: build (${{ matrix.osversion }}) | |
runs-on: ubuntu-20.04 | |
container: | |
image: docker.io/lkiesow/opencast-rpmbuild:${{ matrix.osversion }}-oc13.2 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: cache local maven repository | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: clone mvn.opencast.org | |
run: | | |
git clone --depth 1 https://github.com/opencast/mvn.opencast.org.git | |
- name: clone opencast | |
run: | | |
git clone https://github.com/opencast/opencast.git | |
- name: show build ref | |
id: build_ref | |
run: | | |
sed -n 's/%define srcversion \(.*\)$/\1/p' rpmbuild/SPECS/opencast.spec \ | |
| tee ~/version | |
- name: checkout opencast ref | |
working-directory: opencast | |
run: | | |
git checkout $(cat ~/version) | |
- name: prepare additional maven repository | |
working-directory: opencast | |
run: | | |
sed -i "s#https://mvn.opencast.org/#file://$(readlink -f ../mvn.opencast.org)#" pom.xml | |
- name: build opencast | |
working-directory: opencast | |
run: > | |
mvn | |
--batch-mode | |
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120 | |
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn | |
-Dcheckstyle.skip=true | |
-DskipTests | |
clean install | |
- name: list distributions to build | |
run: | | |
find opencast/build/ -type f -name 'opencast-dist-*gz' \ | |
| sed 's/^.*opencast-dist-\([^-]*\)-.*$/\1/' \ | |
| tee rpmbuild/SPECS/dists | |
- name: move build artifacts | |
run: | | |
cp -rv rpmbuild/ ~ | |
mv -v opencast/build/opencast-dist-*.tar.gz ~/rpmbuild/SOURCES/ | |
- name: build repository rpm | |
working-directory: /github/home/rpmbuild/SPECS | |
run: | | |
rpmbuild -ba opencast-repository.spec | |
- name: build rpms | |
working-directory: /github/home/rpmbuild/SPECS | |
run: | | |
for dist in $(cat dists); do | |
rpmbuild -ba -D "ocdist ${dist}" opencast.spec | |
done | |
- name: list rpms | |
working-directory: /github/home/rpmbuild/RPMS/noarch | |
run: | | |
du -hs opencast*.rpm | |
- name: configure s3cmd | |
env: | |
S3_HOST: ${{ secrets.S3_HOST }} | |
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} | |
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} | |
run: | | |
echo "host_base = ${S3_HOST}" > "$HOME/.s3cfg" | |
echo "host_bucket = ${S3_HOST}" >> "$HOME/.s3cfg" | |
echo "bucket_location = us-east-1" >> "$HOME/.s3cfg" | |
echo "use_https = True" >> "$HOME/.s3cfg" | |
echo "access_key = ${S3_ACCESS_KEY}" >> "$HOME/.s3cfg" | |
echo "secret_key = ${S3_SECRET_KEY}" >> "$HOME/.s3cfg" | |
echo "signature_v2 = False" >> "$HOME/.s3cfg" | |
- name: publish repository rpm | |
working-directory: /github/home/rpmbuild/RPMS/noarch | |
run: | | |
s3cmd put -P opencast-repository*.rpm "s3://opencast-rpmbuild/rpms/${{ matrix.osversion }}/" | |
rm opencast-repository*.rpm | |
- name: publish opencast rpms | |
working-directory: /github/home/rpmbuild/RPMS/noarch | |
run: | | |
s3cmd put -P *.rpm "s3://opencast-rpmbuild/rpms/${{ matrix.osversion }}/$(cat ~/version)/" | |
- name: publish srpms | |
working-directory: /github/home/rpmbuild/SRPMS | |
run: | | |
s3cmd put -P opencast-allinone-*.src.rpm "s3://opencast-rpmbuild/srpms/${{ matrix.osversion }}/$(cat ~/version)/" | |
s3cmd put -P opencast-repository-*.src.rpm "s3://opencast-rpmbuild/srpms/${{ matrix.osversion }}/" | |
- name: send notification | |
env: | |
MATRIX_PASS: ${{ secrets.MATRIX_PASS }} | |
MATRIX_USER: ${{ secrets.MATRIX_USER }} | |
URL_LOGIN: 'https://matrix.org/_matrix/client/r0/login' | |
URL_LOGOUT: 'https://matrix.org/_matrix/client/r0/logout' | |
URL_MESSAGE: 'https://matrix.org/_matrix/client/r0/rooms/%21gwaqKjZRpCQkpkTVwh%3Amatrix.org/send/m.room.message' | |
run: | | |
MESSAGE="Finished building Opencast $(cat ~/version) RPMs (${{ matrix.osversion }})" | |
TOKEN="$(curl -s -XPOST -d '{"type":"m.login.password", "user":"'"$MATRIX_USER"'", "password":"'"$MATRIX_PASS"'", "initial_device_display_name":"GitHub Actions"}' "$URL_LOGIN" | jq -r .access_token)" | |
curl -s -XPOST -d '{"msgtype":"m.text", "body":"'"${MESSAGE}"'"}' "${URL_MESSAGE}?access_token=${TOKEN}" | |
curl -s -XPOST "${URL_LOGOUT}?access_token=${TOKEN}" |