Skip to content

Commit

Permalink
Update / Overhaul CI configuration (sailfishos-patches#330)
Browse files Browse the repository at this point in the history
* Update / Overhaul CI configuration

* Create ci_sfos3.4.0-i486.yml

* Update and rename ci-sfos3.4.0.yml to ci_sfos3.4.0-armv7hl.yml

* Create ci_sfos4.0.1-aarch64.yml

* Create ci_sfos4.4.0-aarch64-armv7hl-i486.yml

* Update ci_sfos4.0.1-aarch64.yml

* Update ci_sfos4.0.1-aarch64.yml

* Update ci_sfos3.4.0-armv7hl.yml

* Introduce caching of SDK images

* Introduce caching of SDK images

* Introduce caching of SDK images

* Introduce caching of SDK images

* Fix

* Raise timeout for builds triggered by a git tag

* Raise timeout for builds triggered by a git tag

* Raise timeout for builds triggered by a git tag

* Indent

* Use "latest"

* Missed "latest"

* indent

* Indent

* Indent

* Insert two "-" in comments

* Address more "unappllies"

* Set base image to ubuntu-22.04
  … because ubuntu-latest is a moving target and the GitHub-action scripts are versioned any way, hence manual version updates are inevitable.

* Set base image to ubuntu-22.04
  … because ubuntu-latest is a moving target and the GitHub-action scripts are versioned any way, hence manual version updates are inevitable.

* More elaborate comments

* Set base image to ubuntu-22.04
  … because ubuntu-latest is a moving target and the GitHub-action scripts are versioned any way, hence manual version updates are inevitable.

* Set base image to ubuntu-22.04
  … because ubuntu-latest is a moving target and the GitHub-action scripts are versioned any way, hence manual version updates are inevitable.

* Set base image to ubuntu-22.04
  … because ubuntu-latest is a moving target and the GitHub-action scripts are versioned any way, hence manual version updates are inevitable.

* Omit (ab)use of bash arrays

* Shorten comment

* Omit (ab)use of bash arrays

* Omit (ab)use of bash arrays

* Omit (ab)use of bash arrays

* Drop last `|| true`, because the scriptlets 
  … (`%pre*`, `%post*`, %trigger*` and `%file*`) are not run with `set -e` (in contrast to main sections `%prep`, `%build` and `%install`), but they shall not return an exit code ≠ 0 (i.e., must not indicate a failure of then whole scriptlet; hence they all conclude with an explicit `exit 0`), otherwise the ongoing RPM transaction might fail and the RPM database may become corrupted (presumably not if the `%pre` scriptlet fails, because the transaction has not started yet, then).
  • Loading branch information
Olf0 authored Jan 13, 2023
1 parent 19ddc9c commit 13c5134
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,44 +1,54 @@
name: Github CI build
name: CI on SFOS-latest (aarch64,armv7hl,i486)

on:
push:
tags:
- '*'
pull_request:
branches:
- master
- patchmanager3

env:
RELEASE: 4.0.1.45
RELEASE: latest

jobs:
build:
runs-on: ubuntu-latest

runs-on: ubuntu-22.04
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Prepare
run: mkdir output

- name: Build armv7hl
# 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 aarch64
# mb2 wants bash: https://github.com/sailfishos/sdk-setup/blob/master/sdk-setup/src/mb2#L1
run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/bash -c "
mkdir -p build ;
cd build ;
cp -r /share/* . ;
mb2 -t SailfishOS-$RELEASE-armv7hl build --enable-debug ;
mb2 -t SailfishOS-$RELEASE-aarch64 build --enable-debug ;
sudo cp -r RPMS/*.rpm /share/output"

- name: Build aarch64
- name: Build armv7hl
# mb2 wants bash: https://github.com/sailfishos/sdk-setup/blob/master/sdk-setup/src/mb2#L1
run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/bash -c "
mkdir -p build ;
cd build ;
cp -r /share/* . ;
mb2 -t SailfishOS-$RELEASE-aarch64 build --enable-debug ;
mb2 -t SailfishOS-$RELEASE-armv7hl build --enable-debug ;
sudo cp -r RPMS/*.rpm /share/output"

- name: Build i486
# mb2 wants bash: https://github.com/sailfishos/sdk-setup/blob/master/sdk-setup/src/mb2#L1
run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/bash -c "
mkdir -p build ;
cd build ;
Expand All @@ -47,21 +57,20 @@ jobs:
sudo cp -r RPMS/*.rpm /share/output"

- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: output-rpms
path: output
path: output/

- name: Create release
if: contains(github.ref, 'release')
run: |
set -x
assets=()
assets=""
for asset in output/*.rpm; do
assets+=("-a" "$asset")
assets="$assets -a $asset"
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
hub release create"$assets" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

62 changes: 62 additions & 0 deletions .github/workflows/ci_sfos3.4.0-armv7hl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI on SFOS 3.4.0 (armv7hl)

on:
push:
tags:
- '*'
pull_request:
branches:
- master
- patchmanager3

env:
RELEASE: 3.4.0.24

jobs:
build:
runs-on: ubuntu-22.04
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare
run: mkdir output

# 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 armv7hl
# mb2 wants bash: https://github.com/sailfishos/sdk-setup/blob/master/sdk-setup/src/mb2#L1
run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/bash -c "
mkdir -p build ;
cd build ;
cp -r /share/* . ;
mb2 -t SailfishOS-$RELEASE-armv7hl build --enable-debug ;
sudo cp -r RPMS/*.rpm /share/output"

- name: Upload build result
uses: actions/upload-artifact@v3
with:
name: output-rpms
path: output/

- 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 }}
58 changes: 58 additions & 0 deletions .github/workflows/ci_sfos3.4.0-i486.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI on SFOS 3.4.0 (i486)

on:
push:
tags:
- '*'

env:
RELEASE: 3.4.0.24

jobs:
build:
runs-on: ubuntu-22.04
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare
run: mkdir output

# 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 i486
# mb2 wants bash: https://github.com/sailfishos/sdk-setup/blob/master/sdk-setup/src/mb2#L1
run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/bash -c "
mkdir -p build ;
cd build ;
cp -r /share/* . ;
mb2 -t SailfishOS-$RELEASE-i486 build --enable-debug ;
sudo cp -r RPMS/*.rpm /share/output"

- name: Upload build result
uses: actions/upload-artifact@v3
with:
name: output-rpms
path: output/

- 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 }}
58 changes: 58 additions & 0 deletions .github/workflows/ci_sfos4.0.1-aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI on SFOS 4.0.1 (aarch64)

on:
push:
tags:
- '*'

env:
RELEASE: 4.0.1.45

jobs:
build:
runs-on: ubuntu-22.04
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare
run: mkdir output

# 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 aarch64
# mb2 wants bash: https://github.com/sailfishos/sdk-setup/blob/master/sdk-setup/src/mb2#L1
run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/bash -c "
mkdir -p build ;
cd build ;
cp -r /share/* . ;
mb2 -t SailfishOS-$RELEASE-aarch64 build --enable-debug ;
sudo cp -r RPMS/*.rpm /share/output"

- name: Upload build result
uses: actions/upload-artifact@v3
with:
name: output-rpms
path: output/

- 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 }}
6 changes: 3 additions & 3 deletions rpm/patchmanager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ case "$1" in
;;
[2-9]) # Update
echo "Updating %{name}: %%pre section"
# Unapply all patches if Patchmanager 2.x is installed
# Disable and deactivate ("unapply") all Patches if Patchmanager 2.x is installed
if [ -d /var/lib/patchmanager/ausmt/patches/ ]
then
/usr/sbin/patchmanager --unapply-all || true
/usr/sbin/patchmanager --unapply-all
if [ -n "$(ls -A /var/lib/patchmanager/ausmt/patches/)" ]
then
echo "Unapply all patches before updating %{name}!"
echo "Do disable ("unapply") all Patches: %{name} must not be updated unless all Patches are inactive!"
exit 1 # An exit N with N ≠ 0 in a %%pre scriptlet might not constitute an
# appropriate way to terminate an update (here: from PM2 to PM3), see e.g.,
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
Expand Down
2 changes: 1 addition & 1 deletion src/tools/pm_apply
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PATCH_NAME="unified_diff.patch"
PATCH_PATH="$PATCH_DIR/$PATCH_NAME"
PATCH_EDITED_NAME="unified_diff_${SYS_BITNESS}bit.patch"

# list of candidate paths to attempt 32/64bit library path correction
# list of candidate paths to attempt 32-/64-bit library path correction
MANGLE_CANDIDATES=""
if [ -z "$DISABLE_MANGLING" ] && [ -r "/etc/patchmanager/manglelist.conf" ] ; then
source /etc/patchmanager/manglelist.conf
Expand Down

0 comments on commit 13c5134

Please sign in to comment.