-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.78 KB
/
build-deb.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
name: Build and Release DEB Package
on:
push:
tags:
- '*'
jobs:
rpm-release:
name: Create DEB release
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y dpkg-dev
- name: Check Directory
run: |
pwd
ls
- name: Create directories for DEB packaging
run: |
mkdir -p nagios-plugins-ets-1.4/usr/lib64/nagios/plugins
mkdir -p nagios-plugins-ets-1.4/DEBIAN
- name: Print folder structure
run: |
ls -R nagios-plugins-ets-1.4
- name: Download plugin files
run: |
# Download each file using wget
wget -O nagios-plugins-ets-1.4/check_mem.c https://github.com/ucsd-ets/nagios-plugins-ets/blob/master/check_mem.c
wget -O nagios-plugins-ets-1.4/usr/lib64/nagios/plugins/check_service https://github.com/ucsd-ets/nagios-plugins-ets/blob/master/check_service
wget -O nagios-plugins-ets-1.4/usr/lib64/nagios/plugins/check_smartctl https://github.com/ucsd-ets/nagios-plugins-ets/blob/master/check_smartctl
wget -O nagios-plugins-ets-1.4/usr/lib64/nagios/plugins/check_smartmon2.py https://github.com/ucsd-ets/nagios-plugins-ets/blob/master/check_smartmon2.py
wget -O nagios-plugins-ets-1.4/usr/lib64/nagios/plugins/check_smartmon.py https://github.com/ucsd-ets/nagios-plugins-ets/blob/master/check_smartmon.py
wget -O nagios-plugins-ets-1.4/usr/lib64/nagios/plugins/check_zpools.sh https://github.com/ucsd-ets/nagios-plugins-ets/blob/master/check_zpools.sh
chmod 755 nagios-plugins-ets-1.4/usr/lib64/nagios/plugins/*
- name: Print folder structure
run: |
ls -R nagios-plugins-ets-1.4
- name: Copy plugin files
run: |
cp control nagios-plugins-ets-1.4/DEBIAN/
cp postinst nagios-plugins-ets-1.4/DEBIAN/
- name: Build DEB package
run: dpkg-deb --build nagios-plugins-ets-1.4
- name: Extract tag name
id: extract_tag
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.extract_tag.outputs.tag }}
name: Release ${{ steps.extract_tag.outputs.tag }}
draft: false
prerelease: false
- name: Upload DEB package to Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ./nagios-plugins-ets-1.4.deb
content_type: application/vnd.debian.binary-package