Skip to content

Commit

Permalink
Merge pull request #1192 from joergsteffens/dev/joergs/master/build-m…
Browse files Browse the repository at this point in the history
…acos

Build MacOS packages via Github Actions
  • Loading branch information
joergsteffens committed Jul 7, 2022
2 parents 8888eb1 + ad235fa commit 6a41db3
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/build-macos.yml
@@ -0,0 +1,82 @@
name: Build Bareos Client on MacOS

on:
workflow_dispatch:
inputs:
jenkins_id:
description: 'Id on the Jenkins server'
type: string
required: true
default: 'jid'
bareos_version:
description: 'Bareos version to build'
type: string
required: true
# Push is only required initially,
# otherwise the workflow is unknown and not callable by the REST API.
push:
paths:
- .github/workflows/build-macos.yml

env:
target_dir: "${{ github.workspace }}/BUILD_RESULTS/MacOS"

jobs:
build:
name: Build and test MacOS
runs-on: macos-12

steps:
- name: Check input variables
run: |
if [ -z "${{ inputs.bareos_version }}" ]; then
echo "::error ::Missing parameter 'bareos_version'"
exit 1
fi
- name: "Checkout source"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "Checkout tags"
# for get-version.sh, an unshallow git checkout with tags is needed.
run: git fetch --tag

- name: Install dependencies
run: |
brew install jansson
- name: Build pkg
run: |
mkdir cmake-build
cd cmake-build
export CXXFLAGS="-I/usr/local/include"
cmake .. -Dclient-only=yes -DVERSION_STRING="${{ inputs.bareos_version }}"
make package VERBOSE=1
ls -la ./*.pkg
mkdir -p "${{ env.target_dir }}"
mv ./*.pkg "${{ env.target_dir }}"
- name: Ctest
run: |
cd cmake-build
# check if we are modern enough
if [ -f "../core/src/tests/bsock_mock.h" ]; then
result=0
ctest --repeat until-pass:5 -V -S CTestScript.cmake || result=$?
if [ $result -eq 1 ]; then
echo "ctest result $result is expected and OK"
elif [ $result -eq 0 ]; then
echo "ctest result $result is expected and OK"
else
echo "ctest result $result is not 1 or 0, ERROR"
fi
fi
- name: Upload pkg
uses: actions/upload-artifact@v3
with:
name: MacOS
path: ${{ env.target_dir }}/*.pkg
retention-days: 1
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- Bareos 22 removes perl make_catalog_backup.pl in favor of an improved make_catalog_backup shell script. There is a compatibility-wrapper, but that only supports simple cases. If you applied changes to BackupCatalog Job, you should immediately migrate to use make_catalog_backup. See [catalog documentation](https://docs.bareos.org/TasksAndConcepts/CatalogMaintenance.html#backing-up-your-bareos-database) [PR #1081]

### Added
- github-actions: add workflow to build MacOS packages [PR #1192]
- dird: add command line feature to print specific resources [PR #1153]
- Python plugins: add default module_path to search path [PR #1038]
- dird: extend the list command to be able to query volumes and pools by ID [PR #1041]
Expand Down Expand Up @@ -192,7 +193,11 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
[PR #1171]: https://github.com/bareos/bareos/pull/1171
[PR #1172]: https://github.com/bareos/bareos/pull/1172
[PR #1177]: https://github.com/bareos/bareos/pull/1177
[PR #1179]: https://github.com/bareos/bareos/pull/1179
[PR #1180]: https://github.com/bareos/bareos/pull/1180
[PR #1183]: https://github.com/bareos/bareos/pull/1183
[PR #1185]: https://github.com/bareos/bareos/pull/1185
[PR #1189]: https://github.com/bareos/bareos/pull/1189
[PR #1192]: https://github.com/bareos/bareos/pull/1192
[PR #1193]: https://github.com/bareos/bareos/pull/1193
[unreleased]: https://github.com/bareos/bareos/tree/master

0 comments on commit 6a41db3

Please sign in to comment.