-
Notifications
You must be signed in to change notification settings - Fork 71
84 lines (73 loc) · 2.88 KB
/
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
name: deb_packager
# test
on:
push:
branches:
- 'main'
paths:
- '**'
tags:
- 'v*.*.*'
- 'v*.*.*-*'
jobs:
build:
permissions:
id-token: write
contents: write
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
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: build the binary
run: make build
- name: making directory structure
run: mkdir -p packaging/deb/zkevm-bridge/usr/bin/
- name: copying necessary binary for amd64
run: cp -rp dist/zkevm-bridge packaging/deb/zkevm-bridge/usr/bin/zkevm-bridge
- name: create directory for service file
run: mkdir -p packaging/deb/zkevm-bridge/lib/systemd/system
- name: copy the service file
run: cp -rp packaging/systemd/zkevm-bridge.service packaging/deb/zkevm-bridge/lib/systemd/system/
# Control file creation
- name: create control file
run: |
echo "Package: zkevm-bridge" >> packaging/deb/zkevm-bridge/DEBIAN/control
echo "Version: ${{ env.VERSION }}" >> packaging/deb/zkevm-bridge/DEBIAN/control
echo "Section: base" >> packaging/deb/zkevm-bridge/DEBIAN/control
echo "Priority: optional" >> packaging/deb/zkevm-bridge/DEBIAN/control
echo "Architecture: amd64" >> packaging/deb/zkevm-bridge/DEBIAN/control
echo "Maintainer: [email protected]" >> packaging/deb/zkevm-bridge/DEBIAN/control
echo "Description: zkevm-bridge binary package" >> packaging/deb/zkevm-bridge/DEBIAN/control
- name: Creating package for binary for zkevm-bridge ${{ env.ARCH }}
run: cp -rp packaging/deb/zkevm-bridge packaging/deb/zkevm-bridge-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: amd64
- name: Running package build
run: dpkg-deb --build --root-owner-group packaging/deb/zkevm-bridge-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: amd64
- name: create checksum for the amd64 package
run: cd packaging/deb/ && sha256sum zkevm-bridge-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > zkevm-bridge-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
ARCH: amd64
- name: Release zkevm-bridge Packages
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.GIT_TAG }}
prerelease: true
files: |
packaging/deb/zkevm-bridge**.deb
packaging/deb/zkevm-bridge**.deb.checksum