Skip to content

Commit

Permalink
merge main into next
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko-von-Leipzig committed Jan 23, 2025
2 parents 1d5d5f8 + b16b9ee commit 7fd192f
Show file tree
Hide file tree
Showing 17 changed files with 416 additions and 499 deletions.
120 changes: 120 additions & 0 deletions .github/actions/build_package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Creates miden-node.deb and miden-faucet.deb DEBIAN packages.
name: build-package
description: Builds miden-node and miden-faucet debian packages for the given git reference
inputs:
gitref:
required: true
description: The git ref to build the packages from.

runs:
using: "composite"
steps:
- name: Identify target git SHA
id: git-sha
shell: bash
run: |
if git show-ref -q --verify "refs/remotes/origin/${{ inputs.gitref }}" 2>/dev/null; then
echo "sha=$(git show-ref --hash --verify 'refs/remotes/origin/${{ inputs.gitref }}')" >> $GITHUB_OUTPUT
elif git show-ref -q --verify "refs/tags/${{ inputs.gitref }}" 2>/dev/null; then
echo "sha=$(git show-ref --hash --verify 'refs/tags/${{ inputs.gitref }}')" >> $GITHUB_OUTPUT
elif git rev-parse --verify "${{ inputs.gitref }}^{commit}" >/dev/null 2>&1; then
echo "sha=$(git rev-parse --verify '${{ inputs.gitref }}^{commit}')" >> $GITHUB_OUTPUT
else
echo "::error::Unknown git reference type"
exit 1
fi
- name: Create package directories
shell: bash
run: |
for pkg in miden-node miden-faucet; do
mkdir -p \
packaging/deb/$pkg/DEBIAN \
packaging/deb/$pkg/usr/bin \
packaging/deb/$pkg/lib/systemd/system \
packaging/deb/$pkg/etc/opt/$pkg \
packaging/deb/$pkg/opt/$pkg
done
# These have to be downloaded as the current repo source isn't necessarily the target git reference.
- name: Copy package install scripts
shell: bash
run: |
# git show ${{ steps.git-sha.outputs.sha }}:packaging/node/miden-node.service > packaging/deb/miden-node/lib/systemd/system/miden-node.service
# git show ${{ steps.git-sha.outputs.sha }}:packaging/node/postinst > packaging/deb/miden-node/DEBIAN/postinst
# git show ${{ steps.git-sha.outputs.sha }}:packaging/node/postrm > packaging/deb/miden-node/DEBIAN/postrm
# git show ${{ steps.git-sha.outputs.sha }}:packaging/faucet/miden-faucet.service > packaging/deb/miden-faucet/lib/systemd/system/miden-faucet.service
# git show ${{ steps.git-sha.outputs.sha }}:packaging/faucet/postinst > packaging/deb/miden-faucet/DEBIAN/postinst
# git show ${{ steps.git-sha.outputs.sha }}:packaging/faucet/postrm > packaging/deb/miden-faucet/DEBIAN/postrm
# This is temporary until these files land on main.
cp packaging/node/miden-node.service packaging/deb/miden-node/lib/systemd/system/miden-node.service
cp packaging/node/postinst packaging/deb/miden-node/DEBIAN/postinst
cp packaging/node/postrm packaging/deb/miden-node/DEBIAN/postrm
cp packaging/faucet/miden-faucet.service packaging/deb/miden-faucet/lib/systemd/system/miden-faucet.service
cp packaging/faucet/postinst packaging/deb/miden-faucet/DEBIAN/postinst
cp packaging/faucet/postrm packaging/deb/miden-faucet/DEBIAN/postrm
chmod 0775 packaging/deb/miden-node/DEBIAN/postinst
chmod 0775 packaging/deb/miden-node/DEBIAN/postrm
chmod 0775 packaging/deb/miden-faucet/DEBIAN/postinst
chmod 0775 packaging/deb/miden-faucet/DEBIAN/postrm
- name: Create control files
shell: bash
run: |
# Map the architecture to the format required by Debian.
# i.e. arm64 and amd64 instead of aarch64 and x86_64.
arch=$(uname -m | sed "s/x86_64/amd64/" | sed "s/aarch64/arm64/")
# Control file's version field must be x.y.z format so strip the rest.
version=$(git describe --tags --abbrev=0 | sed 's/[^0-9.]//g' )
cat > packaging/deb/miden-node/DEBIAN/control << EOF
Package: miden-node
Version: $version
Section: base
Priority: optional
Architecture: $arch
Maintainer: Polygon Devops <[email protected]>
Description: miden-node binary package
Homepage: https://polygon.technology/polygon-miden
Vcs-Git: [email protected]:0xPolygonMiden/miden-node.git
Vcs-Browser: https://github.com/0xPolygonMiden/miden-node
EOF
cat > packaging/deb/miden-faucet/DEBIAN/control << EOF
Package: miden-faucet
Version: $version
Section: base
Priority: optional
Architecture: $arch
Maintainer: Polygon Devops <[email protected]>
Description: miden-faucet binary package
Homepage: https://polygon.technology/polygon-miden
Vcs-Git: [email protected]:0xPolygonMiden/miden-node.git
Vcs-Browser: https://github.com/0xPolygonMiden/miden-node
EOF
- name: Build binaries
shell: bash
env:
repo-url: ${{ github.server_url }}/${{ github.repository }}
run: |
cargo install miden-node --root . --locked --features testing --git ${{ env.repo-url }} --rev ${{ steps.git-sha.outputs.sha }}
cargo install miden-faucet --root . --locked --features testing --git ${{ env.repo-url }} --rev ${{ steps.git-sha.outputs.sha }}
- name: Copy binary files
shell: bash
run: |
cp -p ./bin/miden-node packaging/deb/miden-node/usr/bin/
cp -p ./bin/miden-faucet packaging/deb/miden-faucet/usr/bin/
- name: Build packages
shell: bash
run: |
dpkg-deb --build --root-owner-group packaging/deb/miden-node
dpkg-deb --build --root-owner-group packaging/deb/miden-faucet
# Save the .deb files, delete the rest.
mv packaging/deb/*.deb .
rm -rf packaging
4 changes: 2 additions & 2 deletions .github/actions/ssm_execute/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ runs:
--output text \
--query "Command.CommandId")
echo "command_id=$COMMAND_ID" >> $GITHUB_OUTPUT
continue-on-error: true
continue-on-error: false

- name: Poll command status and retrieve live logs
id: poll_output
Expand Down Expand Up @@ -64,7 +64,7 @@ runs:
break
elif [ "$STATUS" == "Failed" ] || [ "$STATUS" == "Cancelled" ]; then
echo "Command failed with status: $STATUS"
break
exit 1
else
elapsed_time=$(( $(date +%s) - start_time ))
if [ "$elapsed_time" -gt "$timeout" ]; then
Expand Down
134 changes: 0 additions & 134 deletions .github/workflows/amd_deb_packager.yml

This file was deleted.

Loading

0 comments on commit 7fd192f

Please sign in to comment.