Skip to content

arm_deb_packager

arm_deb_packager #69

name: arm_deb_packager
on:
workflow_dispatch:
release:
types: [released, prereleased]
jobs:
build:
permissions:
id-token: write
contents: write
runs-on:
labels: ubuntu22-arm-4core
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
##### TAG Variable #####
- 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: cleaning repo
run: cargo clean
- name: Building for arm64
run: |
cargo build --release --locked --features testing --bin miden-node
cargo build --release --locked --features testing --bin miden-faucet
- name: create package directories
run: |
mkdir -p packaging/deb/miden-node/DEBIAN
mkdir -p packaging/deb/miden-node/usr/bin
mkdir -p packaging/deb/miden-node/lib/systemd/system
mkdir -p packaging/deb/miden-node/etc/miden
mkdir -p packaging/deb/miden-node/opt/miden/miden-node
- name: copy package files
run: |
cp -p target/release/miden-node packaging/deb/miden-node/usr/bin/
cp packaging/miden-node.service packaging/deb/miden-node/lib/systemd/system/
cp packaging/postinst packaging/deb/miden-node/DEBIAN/postinst
cp packaging/postrm packaging/deb/miden-node/DEBIAN/postrm
########### Control file creation for arm64 miden-node##########
- name: create control file
run: |
touch packaging/deb/miden-node/DEBIAN/control
echo "Package: miden-node" >> packaging/deb/miden-node/DEBIAN/control
echo "Version: ${{ env.VERSION }}" >> packaging/deb/miden-node/DEBIAN/control
echo "Section: base" >> packaging/deb/miden-node/DEBIAN/control
echo "Priority: optional" >> packaging/deb/miden-node/DEBIAN/control
echo "Architecture: arm64" >> packaging/deb/miden-node/DEBIAN/control
echo "Maintainer: Polygon Devops <[email protected]>" >> packaging/deb/miden-node/DEBIAN/control
echo "Description: miden-node binary package" >> packaging/deb/miden-node/DEBIAN/control
echo "Homepage: https://polygon.technology/polygon-miden" >> packaging/deb/miden-node/DEBIAN/control
echo "Vcs-Git: [email protected]:0xPolygonMiden/miden-node.git" >> packaging/deb/miden-node/DEBIAN/control
echo "Vcs-Browser: https://github.com/0xPolygonMiden/miden-node" >> packaging/deb/miden-node/DEBIAN/control
- name: Creating package for binary for miden-node ${{ env.ARCH }}
run: cp -rp packaging/deb/miden-node packaging/deb/miden-node-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: arm64
- name: Running package build
run: dpkg-deb --build --root-owner-group packaging/deb/miden-node-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: arm64
########## Miden Faucet Package ##########################################
- name: create package directories
run: |
mkdir -p packaging/deb/miden-faucet/DEBIAN
mkdir -p packaging/deb/miden-faucet/usr/bin
mkdir -p packaging/deb/miden-faucet/lib/systemd/system
mkdir -p packaging/deb/miden-faucet/etc/miden
mkdir -p packaging/deb/miden-faucet/opt/miden/miden-faucet
- name: copy package files
run: |
cp -p target/release/miden-faucet packaging/deb/miden-faucet/usr/bin/
cp packaging/miden-faucet.service packaging/deb/miden-faucet/lib/systemd/system/
cp packaging/postinst packaging/deb/miden-faucet/DEBIAN/postinst
cp packaging/postrm.faucet packaging/deb/miden-faucet/DEBIAN/postrm
########### Control file creation for arm64 miden-faucet ##########
- name: create control file
run: |
touch packaging/deb/miden-faucet/DEBIAN/control
echo "Package: miden-faucet" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Version: ${{ env.VERSION }}" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Section: base" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Priority: optional" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Architecture: arm64" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Maintainer: Polygon Devops <[email protected]>" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Description: miden-faucet binary package" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Homepage: https://polygon.technology/polygon-miden" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Vcs-Git: [email protected]:0xPolygonMiden/miden-node.git" >> packaging/deb/miden-faucet/DEBIAN/control
echo "Vcs-Browser: https://github.com/0xPolygonMiden/miden-node" >> packaging/deb/miden-faucet/DEBIAN/control
- name: Creating package for binary for miden-faucet ${{ env.ARCH }}
run: cp -rp packaging/deb/miden-faucet packaging/deb/miden-faucet-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: arm64
- name: Running package build
run: dpkg-deb --build --root-owner-group packaging/deb/miden-faucet-${{ env.GIT_TAG }}-${{ env.ARCH }}
env:
ARCH: arm64
- name: shasum the package
run: cd packaging/deb/ && sha256sum miden-node-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > miden-node-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
ARCH: arm64
- name: shasum the package
run: cd packaging/deb/ && sha256sum miden-faucet-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb > miden-faucet-${{ env.GIT_TAG }}-${{ env.ARCH }}.deb.checksum
env:
ARCH: arm64
- name: release miden-node Packages
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.GIT_TAG }}
prerelease: true
files: |
packaging/deb/miden-node**.deb
packaging/deb/miden-node**.deb.checksum
packaging/deb/miden-faucet**.deb
packaging/deb/miden-faucet**.deb.checksum