[ci-on-tags.yml] Shorten job names #20
Workflow file for this run
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: CI on tags | |
on: | |
push: | |
tags: | |
# '**' also matches the slash ('/'), in contrast to '*', | |
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet | |
- '**' | |
defaults: | |
run: | |
# Note thas 'bash' provides -o pipefail, in contrast to the default (i.e., unspecified, which also uses bash) or 'sh', | |
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell | |
shell: sh | |
# See, e.g.: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow | |
concurrency: | |
group: ci-${{ github.ref_name }} | |
# 'false' (default) allows for two concurrent runs, one executing and one freshly enqueued; 'true' for only one; no 'concurrency:' defined for multiple. | |
cancel-in-progress: true | |
jobs: | |
# One job for the latest Docker images used and one for the oldest ones. | |
# Trying to download three multi-GB, layered docker images in a single job may | |
# result in "docker: write /var/lib/docker/tmp/GetImageBlobXYZ: no space left on device." | |
SFOS-SDK: | |
strategy: | |
matrix: | |
# See https://hub.docker.com/r/coderus/sailfishos-platform-sdk/tags for available images. | |
# Use the newest available Docker SFOS-Platform-SDK image and the oldest image on which the build works. | |
release: [4.5.0.16, 4.0.1.45] | |
# Cannot use two matrix dimensions, because the ARCH-specific builds must be | |
# carried out in a single job to allow for reuse of the downloaded Docker image. | |
env: | |
# Do not wait up to the default of 10 minutes for network timeouts in a workflow which runs ca. 20 minutes. | |
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 | |
RELEASE: ${{ matrix.release }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
#- name: Prepare | |
# run: | |
# Caching Docker images is not ready yet, see | |
# https://github.com/storeman-developers/harbour-storeman-installer/blob/devel/cache-docker-images_github-ci.md | |
#- name: Cache Docker images of the Sailfish-SDK | |
# id: cache-sdk | |
# uses: actions/cache@v3 | |
# with: | |
# path: $GITHUB_WORKSPACE/… | |
# key: cache | |
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} | |
env: | |
ARCH: aarch64 | |
run: | | |
set -x | |
mkdir -p output/$RELEASE/$ARCH | |
docker run --rm -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/sh -xc ' | |
mkdir -p rpmbuild/SOURCES | |
printf %s "${{ secrets.TOKEN_GITHUB }}" > rpmbuild/SOURCES/token-github.txt | |
printf %s "${{ secrets.TOKEN_GITLAB }}" > rpmbuild/SOURCES/token-gitlab.txt | |
mkdir -p build/rpm | |
cp rpmbuild/SOURCES/token-git??b.txt build/rpm/ | |
cd build | |
cp -r /share/. . | |
mb2 -t SailfishOS-$1-$2 build -d | |
sudo cp -r RPMS/. /share/output/$1/$2/' sh_mb2 $RELEASE $ARCH | |
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} | |
env: | |
ARCH: armv7hl | |
run: | | |
set -x | |
mkdir -p output/$RELEASE/$ARCH | |
docker run --rm -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/sh -xc ' | |
mkdir -p rpmbuild/SOURCES | |
printf %s "${{ secrets.TOKEN_GITHUB }}" > rpmbuild/SOURCES/token-github.txt | |
printf %s "${{ secrets.TOKEN_GITLAB }}" > rpmbuild/SOURCES/token-gitlab.txt | |
mkdir -p build/rpm | |
cp rpmbuild/SOURCES/token-git??b.txt build/rpm/ | |
cd build | |
cp -r /share/. . | |
mb2 -t SailfishOS-$1-$2 build -d | |
sudo cp -r RPMS/. /share/output/$1/$2/' sh_mb2 $RELEASE $ARCH | |
- name: Build ${{ env.ARCH }} on ${{ env.RELEASE }} | |
env: | |
ARCH: i486 | |
run: | | |
set -x | |
mkdir -p output/$RELEASE/$ARCH | |
docker run --rm -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/sh -xc ' | |
mkdir -p rpmbuild/SOURCES | |
printf %s "${{ secrets.TOKEN_GITHUB }}" > rpmbuild/SOURCES/token-github.txt | |
printf %s "${{ secrets.TOKEN_GITLAB }}" > rpmbuild/SOURCES/token-gitlab.txt | |
mkdir -p build/rpm | |
cp rpmbuild/SOURCES/token-git??b.txt build/rpm/ | |
cd build | |
cp -r /share/. . | |
mb2 -t SailfishOS-$1-$2 build -d | |
sudo cp -r RPMS/. /share/output/$1/$2/' sh_mb2 $RELEASE $ARCH | |
- name: Upload build results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: RPM-build-results_SFOS${{ env.RELEASE }} | |
path: output/ | |
# Due to building two releases for each architecture, they will clobber each other, | |
# when uploaded to the single directory of a GITHUB_REF | |
# - name: Create release | |
# if: contains(github.ref, 'release') | |
# run: | | |
# set -x | |
# assets="" | |
# for asset in output/*/*/*.rpm; do | |
# assets="$assets -a $asset" | |
# done | |
# tag_name="${GITHUB_REF##*/}" | |
# hub release create"$assets" -m "$tag_name" "$tag_name" | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |