Skip to content

Commit

Permalink
Update build-deb.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
swapnilucsd authored Jul 4, 2024
1 parent 9a54bcb commit bb47277
Showing 1 changed file with 43 additions and 44 deletions.
87 changes: 43 additions & 44 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,48 @@ on:
- 'v*'

jobs:
build:
build_and_release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y dpkg-dev

- 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: Copy files
run: |
cp DEBIAN/control nagios-plugins-ets-1.4/DEBIAN/
cp DEBIAN/postinst nagios-plugins-ets-1.4/DEBIAN/
chmod 755 nagios-plugins-ets-1.4/DEBIAN/postinst
cp check_mem.c nagios-plugins-ets-1.4/check_mem.c
cp -r usr/lib64/nagios/plugins/* nagios-plugins-ets-1.4/usr/lib64/nagios/plugins/
- name: Build DEB package
run: dpkg-deb --build nagios-plugins-ets-1.4

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload DEB package to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nagios-plugins-ets-1.4.deb
asset_name: nagios-plugins-ets-1.4.deb
asset_content_type: application/vnd.debian.binary-package
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y dpkg-dev

- 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: Copy files
run: |
cp DEBIAN/control nagios-plugins-ets-1.4/DEBIAN/
cp DEBIAN/postinst nagios-plugins-ets-1.4/DEBIAN/
chmod 755 nagios-plugins-ets-1.4/DEBIAN/postinst
cp check_mem.c nagios-plugins-ets-1.4/check_mem.c
cp -r usr/lib64/nagios/plugins/* nagios-plugins-ets-1.4/usr/lib64/nagios/plugins/
- name: Build DEB package
run: dpkg-deb --build nagios-plugins-ets-1.4

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload DEB package to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nagios-plugins-ets-1.4.deb
asset_name: nagios-plugins-ets-1.4.deb
asset_content_type: application/vnd.debian.binary-package

0 comments on commit bb47277

Please sign in to comment.