-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (76 loc) · 2.74 KB
/
x86_deb_packager.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
78
79
80
81
82
83
84
85
86
87
88
89
name: x86_deb_packager
on:
push:
branches:
- 'main'
paths:
- '**'
tags:
- 'v*.*.*'
- 'v*.*.*-*'
jobs:
build:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.22.x
# Variables
- name: Adding TAG to ENV
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: adding version
run: |
NUMERIC_VERSION=$( echo ${{ env.GIT_TAG }} | sed 's/[^0-9.]//g' )
echo "VERSION=$NUMERIC_VERSION" >> $GITHUB_ENV
- name: go mod download
run: go mod download
- name: Build the binary
run: make build
- name: Build the rust binary
run: |
BUILD_SCRIPT_DISABLED=1
cargo build --release --bin cdk
- name: making directory structure
run: mkdir -p packaging/deb/cdk/usr/bin/
- name: copying necessary binary for amd64
run: cp -rp target/cdk-node packaging/deb/cdk/usr/bin/cdk-node
- name: copying rust binary for amd64
run: cp -rp target/release/cdk packaging/deb/cdk/usr/bin/cdk
# Control file creation
- name: Create control file
run: |
echo "Package: cdk" >> packaging/deb/cdk/DEBIAN/control
echo "Version: ${{ env.VERSION }}" >> packaging/deb/cdk/DEBIAN/control
echo "Section: base" >> packaging/deb/cdk/DEBIAN/control
echo "Priority: optional" >> packaging/deb/cdk/DEBIAN/control
echo "Architecture: amd64" >> packaging/deb/cdk/DEBIAN/control
echo "Maintainer: [email protected]" >> packaging/deb/cdk/DEBIAN/control
echo "Description: cdk binary package" >> packaging/deb/cdk/DEBIAN/control
- name: Creating package for binary for cdk ${{ env.ARCH }}
run: cp -rp packaging/deb/cdk packaging/deb/cdk-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: amd64
- name: Running package build
run: dpkg-deb --build --root-owner-group packaging/deb/cdk-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: amd64
- name: Create checksum for the amd64 package
run: cd packaging/deb/ && sha256sum cdk-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > cdk-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
ARCH: amd64
- name: Release cdk Packages
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.GIT_TAG }}
prerelease: true
files: |
packaging/deb/cdk**.deb
packaging/deb/cdk**.deb.checksum