-
Notifications
You must be signed in to change notification settings - Fork 11
104 lines (93 loc) · 3.21 KB
/
mkp-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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: MKP-Release
on:
workflow_dispatch:
push:
branches:
- 'v1/stable'
jobs:
build_v2:
name: Build Robotmk MKP
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: Install tools
run: apt update && apt-get -y install sudo jq tree hub
- name: Create Checkmk Site
run: /docker-entrypoint.sh /bin/true
- name: Checkout Robotmk repository
uses: actions/checkout@v2
- name: Link repository files into container
run: .devcontainer/linkfiles.sh
- name: Update GITHUB_PATH
run: echo "/omd/sites/cmk/bin" >> $GITHUB_PATH
# Uncomment this to debug
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Build MKP
run: .devcontainer/build.sh
id: cmkpkg
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.cmkpkg.outputs.artifactname }}
path: ${{ steps.cmkpkg.outputs.pkgfile }}
# ////////////////////////////////////////////////////////////////////////
# https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts#downloading-or-deleting-artifacts
release:
name: Release Robotmk MKP
runs-on: ubuntu-latest
needs:
# - build_v1
- build_v2
env:
WORKSPACE: ${{ github.workspace }}
steps:
- name: Install tools
run: apt update && apt-get -y install hub
- name: Checkout Robotmk repository
uses: actions/checkout@v2
- name: Download CMK1/2 artifact
uses: actions/download-artifact@v2
with:
# download dir
path: package
- name: Debug - Show downloaded content
run: ls -la package/*
- name: Show ref
run: echo ${GITHUB_REF##*/}
- name: curl chag
uses: wei/curl@master
with:
args: https://raw.githubusercontent.com/mtdowling/chag/master/chag --output chag
- name: chag
run: bash chag contents > RELEASE_CHANGELOG.md
- name: Get Tag
id: tag
run: echo ::set-output name=VERSION::${GITHUB_REF##*/}
# (The Release text will be taken from the annotated tag, created with "chag")
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${{ steps.tag.outputs.VERSION }}
with:
name: Release ${{ steps.tag.outputs.VERSION }}
body_path: RELEASE_CHANGELOG.md
tag_name: ${{ steps.tag.outputs.VERSION }}
draft: false
prerelease: false
# -m "" means: Leave the Release mesage body as it is, do not modify
- name: Add Release Assets
run: hub release edit $(find package/ -type f -name "*.mkp" -printf "-a %p ") -m "" "${GITHUB_REF#refs/*/}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Uncomment this to debug
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3