Skip to content

generate deb pakcage in pipeline #8

generate deb pakcage in pipeline

generate deb pakcage in pipeline #8

Workflow file for this run

name: Build and Release Encrypto Deb Package
on:
push:
tags:
- 'v*.*.*'
jobs:
build-and-release:
name: Build and Release Encrypto Binary
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set Maven
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Build encrypto with Maven
run: mvn clean package -Pnative
- name: Copy new version of binary to deb package files
run: |
cp ./target/native/encrypto ./encrypto/bin/encrypto
version=${{ github.ref_name }}
version=${version#v}
sed -i "s/^Version:.*/Version: ${version}/" ./encrypto/DEBIAN/control
dpkg-deb --root-owner-group --build encrypto
lintian encrypto.deb
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: 'Build Encrypto Deb Package'
draft: false
prerelease: false
- name: Upload Binary to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/native/encrypto
asset_name: encrypto
asset_content_type: application/octet-stream
- name: Upload .deb package to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./encrypto.deb
asset_name: encrypto.deb
asset_content_type: application/vnd.debian.binary-package