-
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (45 loc) · 1.44 KB
/
build-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: build-release
on:
push:
tags:
- 'v*'
- '!v*[a-z]'
jobs:
build-release:
name: Build Release Package
runs-on: ubuntu-latest
container:
image: checkmk/check-mk-raw:2.3.0-latest
permissions:
contents: write
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: Create Release
uses: softprops/action-gh-release@v2
with:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
files: ${{ steps.cmkpkg.outputs.pkgfile }}