Skip to content

Commit 5e9e42a

Browse files
committed
fx
1 parent 8bc2631 commit 5e9e42a

File tree

3 files changed

+144
-7
lines changed

3 files changed

+144
-7
lines changed
File renamed without changes.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Build debian package
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
artifact_id:
7+
required: true
8+
type: string
9+
version:
10+
required: true
11+
type: string
12+
secrets:
13+
cf_token:
14+
required: false
15+
16+
jobs:
17+
build:
18+
permissions:
19+
id-token: write
20+
contents: write
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Download a single artifact
25+
uses: actions/download-artifact@v4
26+
with:
27+
name: ${{ inputs.artifact_id }}
28+
29+
- name: Debug 1
30+
run: |
31+
pwd
32+
ls -lao
33+
34+
- name: Update and install required packages
35+
run: sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y dpkg-dev debhelper
36+
37+
- name: clearing dpkg
38+
run: sudo dpkg --clear-avail
39+
40+
# Creating directory structure
41+
- name: making directory structure
42+
run: |
43+
mkdir -p packaging/deb/erigon/usr/bin
44+
mkdir -p packaging/deb/erigon/opt/erigon
45+
46+
47+
- name: debug -- exit
48+
run: exit 1
49+
50+
- name: copy the binary for amd64 over
51+
run: cp -rp build/bin/erigon packaging/deb/erigon/usr/bin/
52+
- name: create systemd directory for service file
53+
run: mkdir -p packaging/deb/erigon/lib/systemd/system
54+
- name: copy the erigon service file for systemd
55+
run: cp -rp packaging/package_scripts/erigon.service packaging/deb/erigon/lib/systemd/system/
56+
57+
# Create control file and packaging
58+
- name: create control file
59+
run: |
60+
touch packaging/deb/erigon/DEBIAN/control
61+
echo "Package: erigon" >> packaging/deb/erigon/DEBIAN/control
62+
echo "Version: ${{ env.VERSION }}" >> packaging/deb/erigon/DEBIAN/control
63+
echo "Section: base" >> packaging/deb/erigon/DEBIAN/control
64+
echo "Priority: optional" >> packaging/deb/erigon/DEBIAN/control
65+
echo "Architecture: amd64" >> packaging/deb/erigon/DEBIAN/control
66+
echo "Maintainer: [email protected]" >> packaging/deb/erigon/DEBIAN/control
67+
echo "Description: erigon package" >> packaging/deb/erigon/DEBIAN/control
68+
- name: Creating package directory for binary for erigon ${{ env.ARCH }}
69+
run: cp -rp packaging/deb/erigon packaging/deb/erigon-${{ env.GIT_TAG }}-${{ env.ARCH }}
70+
env:
71+
ARCH: amd64
72+
- name: Running package build for ${{ env.ARCH }}
73+
run: dpkg-deb --build --root-owner-group packaging/deb/erigon-${{ env.GIT_TAG }}-${{ env.ARCH }}
74+
env:
75+
ARCH: amd64
76+
77+
# arm64 setup
78+
- name: prepping environment for arm64 build
79+
run: make clean
80+
81+
- name: removing amd64 control file
82+
run: rm -rf packaging/deb/erigon/DEBIAN/control
83+
84+
- name: Adding requirements for cross compile
85+
run: sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
86+
87+
- name: build for arm64
88+
run: GOARCH=arm64 GOOS=linux CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ CGO_ENABLED=1 go build -o build/bin/erigon ./cmd/erigon/main.go
89+
90+
- name: Copying necessary files
91+
run: cp -rp build/bin/erigon packaging/deb/erigon/usr/bin/
92+
- name: create control file
93+
run: |
94+
touch packaging/deb/erigon/DEBIAN/control
95+
echo "Package: erigon" >> packaging/deb/erigon/DEBIAN/control
96+
echo "Version: ${{ env.VERSION }}" >> packaging/deb/erigon/DEBIAN/control
97+
echo "Section: base" >> packaging/deb/erigon/DEBIAN/control
98+
echo "Priority: optional" >> packaging/deb/erigon/DEBIAN/control
99+
echo "Architecture: arm64" >> packaging/deb/erigon/DEBIAN/control
100+
echo "Maintainer: [email protected]" >> packaging/deb/erigon/DEBIAN/control
101+
echo "Description: erigon package" >> packaging/deb/erigon/DEBIAN/control
102+
- name: Creating package directory for binary for erigon ${{ env.ARCH }}
103+
run: cp -rp packaging/deb/erigon packaging/deb/erigon-${{ env.GIT_TAG }}-${{ env.ARCH }}
104+
env:
105+
ARCH: arm64
106+
107+
- name: Running package build for ${{ env.ARCH }}
108+
run: dpkg-deb --build --root-owner-group packaging/deb/erigon-${{ env.GIT_TAG }}-${{ env.ARCH }}
109+
env:
110+
ARCH: arm64
111+
112+
- name: shasum the ${{ env.ARCH }} debian package
113+
run: cd packaging/deb/ && sha256sum erigon-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > erigon-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
114+
env:
115+
ARCH: amd64
116+
117+
- name: shasum the ${{ env.ARCH }} debian package
118+
run: cd packaging/deb/ && sha256sum erigon-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > erigon-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
119+
env:
120+
ARCH: arm64
121+
122+
# Confirm packages built and upload
123+
- name: Confirming package built
124+
run: ls -ltr packaging/deb/ | grep erigon
125+
126+
- name: Release erigon Packages
127+
uses: softprops/action-gh-release@v1
128+
with:
129+
tag_name: ${{ env.GIT_TAG }}
130+
prerelease: true
131+
files: |
132+
packaging/deb/erigon**.deb
133+
packaging/deb/erigon**.deb.checksum

.github/workflows/testing-release-gorelease-bkp.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ jobs:
109109
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db ## v3.6.1
110110

111111
- name: Build binaries with goreleaser
112+
if: 1>2
112113
env:
113114
BUILD_VERSION: ${{ inputs.release_version }}
114115
DOCKER_URL: ${{ env.DOCKERHUB_REPOSITORY_DEV }}
@@ -163,6 +164,14 @@ jobs:
163164
--push \
164165
--platform linux/amd64,linux/amd64/v2,linux/arm64 .
165166
167+
- name: TMP create artifacts
168+
run: |
169+
date > ./dist/${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_arm64.tar.gz
170+
date > ./dist/${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64.tar.gz
171+
date > ./dist/${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64v2.tar.gz
172+
date > ./dist/${{ env.APPLICATION }}_${{ inputs.release_version }}_darwin_arm64.tar.gz
173+
date > ./dist/${{ env.APPLICATION }}_${{ inputs.release_version }}_darwin_amd64.tar.gz
174+
166175
- name: Upload artifact -- linux/arm64
167176
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a ## v4.3.6
168177
with:
@@ -236,15 +245,10 @@ jobs:
236245
runs-on: ubuntu-latest
237246
timeout-minutes: 10
238247
name: Build Debian Package
239-
248+
240249
steps:
241-
- name: Checkout git repository
242-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
243-
with:
244-
fetch-depth: 0
245-
246250
- name: Run reusable-build-debian-pkg workflow
247-
uses: ./.github/actions/build-debian-pkg
251+
uses: ${{ env.APP_REPO}}/.github/workflows/reusable-build-debian-pkg.yml@main
248252
with:
249253
artifact_id: ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64.tar.gz
250254
version: ${{ inputs.release_version }}

0 commit comments

Comments
 (0)