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 3, 2024
1 parent 1dc1ef7 commit 0e74775
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: release
on:
push:
# tags:
# - "v*.*.*"

permissions:
contents: write
Expand All @@ -10,41 +12,28 @@ jobs:
deb-release:
name: Create DEB release
runs-on: ubuntu-latest

steps:
- name: Checkout actions
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set DEB_VERSION
run: |
echo "DEB_VERSION=$(echo ${{ github.ref_name }} | cut -c 2- | sed 's/-/~/g')" >> $GITHUB_ENV
- name: Print DEB_VERSION
run: |
echo DEB_VERSION=$DEB_VERSION
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential devscripts debhelper dh-make
- name: Prepare DEB build directory
sudo apt-get install -y dpkg-dev
- name: Build DEB
run: |
mkdir -p ~/debbuild/nagios-plugins-ets-${{ env.DEB_VERSION }}
cp -r ./* ~/debbuild/nagios-plugins-ets-${{ env.DEB_VERSION }}
cd ~/debbuild/nagios-plugins-ets-${{ env.DEB_VERSION }}
dpkg-deb --build . ../nagios-plugins-ets_${{ env.DEB_VERSION }}.deb
- name: Print DEB Package
run: |
ls -al ~/debbuild/
mkdir -p build
dpkg-deb --build nagios-plugins-ets-1.4 build/nagios-plugins-ets-1.4.deb
- name: Upload DEB as artifact
uses: actions/upload-artifact@v3
with:
name: nagios-plugins-ets-1.4.deb
path: build/nagios-plugins-ets-1.4.deb
- name: Release DEB
uses: softprops/action-gh-release@v1
with:
files: ~/debbuild/nagios-plugins-ets_${{ env.DEB_VERSION }}.deb
files: build/nagios-plugins-ets-1.4.deb
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0e74775

Please sign in to comment.