Merge pull request #21 from jiuka/checkmk23 #86
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 | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- 'v*' | |
pull_request: | |
jobs: | |
build: | |
name: Build Checkmk package | |
runs-on: ubuntu-latest | |
container: | |
image: checkmk/check-mk-raw:2.3.0-latest | |
env: | |
OMD_ROOT: /omd/sites/cmk | |
OMD_SITE: cmk | |
CMK_SITE_ID: cmk | |
WORKSPACE: ${{ github.workspace }} | |
steps: | |
- name: Initialize Checkmk Site | |
run: /docker-entrypoint.sh /bin/true | |
- uses: actions/checkout@v4 | |
- name: Parse Package File | |
run: | | |
NAME=$(python3 -c 'print(eval(open("package").read())["name"])') | |
VERSION=$(python3 -c 'print(eval(open("package").read())["version"])') | |
echo "CMKPKG_NAME=$NAME" >> "$GITHUB_ENV" | |
echo "CMKPKG_VERSION=$VERSION" >> "$GITHUB_ENV" | |
- name: Setup links | |
run: .devcontainer/symlink.sh | |
- name: Build Extension | |
run: | | |
chown -R cmk:cmk $GITHUB_WORKSPACE | |
su -l -c "mkp -v package $GITHUB_WORKSPACE/package" cmk | |
cp /omd/sites/cmk/var/check_mk/packages_local/${CMKPKG_NAME}-${CMKPKG_VERSION}.mkp . | |
echo "pkgfile=${CMKPKG_NAME}-${CMKPKG_VERSION}.mkp" >> $GITHUB_OUTPUT | |
id: cmkpkg | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.cmkpkg.outputs.pkgfile }} | |
path: ${{ steps.cmkpkg.outputs.pkgfile }} |