Skip to content

Build et release debian package #138

Build et release debian package

Build et release debian package #138

name: Build et release debian package
on:
push:
branches: [ main ]
workflow_dispatch:
inputs:
vincrement:
description: 'Package version increment (major.minor.patch)'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
- prerelease
jobs:
build-and-push-deb-pkg:
name: Build deb package and push to repositories
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Fetch latest release version
id: fetch-latest-release
uses: reloc8/[email protected]
- name: Build package
uses: addnab/docker-run-action@v3
id: build
with:
image: ghcr.io/calaos/debian_deb_build_base
options: -v ${{ github.workspace }}:/work
run: |
export release=$(pysemver bump ${{ github.event.inputs.vincrement || 'prerelease' }} ${{ steps.fetch-latest-release.outputs.latest-release }})
echo Build version: $release
/work/build-deb.sh $release && echo "::set-output name=release::$release"
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: deb
path: pkg/*.deb
- name: Create a Release
uses: meeDamian/[email protected]
with:
token: ${{ secrets.ACTION_DISPATCH }}
tag: ${{ steps.build.outputs.release }}
name: ${{ steps.build.outputs.release }}
prerelease: false
files: pkg/*.deb
gzip: false
- name: Update repo cache
uses: distributhor/workflow-webhook@v3
env:
webhook_url: ${{ secrets.WEBHOOK_URL }}
webhook_secret: ${{ secrets.WEBHOOK_SECRET }}