-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3aefd1
commit c03eb04
Showing
2 changed files
with
40 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,23 +12,19 @@ runs: | |
id: git-sha | ||
shell: bash | ||
run: | | ||
if git show-ref -q --verify "refs/remotes/origin/$gitref" 2>/dev/null; then | ||
echo "sha=$(git show-ref --hash --verify "refs/remotes/origin/$gitref")" >> $GITHUB_OUTPUT | ||
elif git show-ref -q --verify "refs/tags/$gitref" 2>/dev/null; then | ||
echo "sha=$(git show-ref --hash --verify "refs/tags/$gitref")" >> $GITHUB_OUTPUT | ||
elif git rev-parse --verify "$gitref^{commit}" >/dev/null 2>&1; then | ||
echo "sha=$(git rev-parse --verify "$gitref^{commit})" >> $GITHUB_OUTPUT | ||
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.gitreff }}^{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 | ||
exit 1 | ||
fi | ||
- name: Build binaries | ||
run: | | ||
cargo install miden-node --locked --features testing --git ${{ github.repositoryUrl }} --rev ${{ steps.git-sha.outputs.sha }} | ||
cargo install miden-faucet --locked --features testing --git ${{ github.repositoryUrl }} --rev ${{ steps.git-sha.outputs.sha }} | ||
- name: Create package directories | ||
shell: bash | ||
run: | | ||
mkdir -p \ | ||
packaging/deb/miden-node/DEBIAN \ | ||
|
@@ -44,13 +40,9 @@ runs: | |
packaging/deb/miden-faucet/etc/miden\ | ||
packaging/deb/miden-faucet/opt/miden/miden-faucet | ||
- name: Copy binary files | ||
run: | | ||
cp -p $CARGO_HOME/bin/miden-node packaging/deb/miden-node/urs/bin/ | ||
cp -p $CARGO_HOME/bin/miden-faucet packaging/deb/miden-faucet/urs/bin/ | ||
# 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/miden-node.service > packaging/deb/miden-node/lib/systemd/system/miden-node.service | ||
git show ${{ steps.git-sha.outputs.sha }}:packaging/postinst > packaging/deb/miden-node/DEBIAN/postinst | ||
|
@@ -59,14 +51,19 @@ runs: | |
git show ${{ steps.git-sha.outputs.sha }}:packaging/postinst > packaging/deb/miden-faucet/DEBIAN/postinst | ||
git show ${{ steps.git-sha.outputs.sha }}:packaging/postrm > packaging/deb/miden-faucet/DEBIAN/postrm | ||
- name: Platform architecture | ||
shell: bash | ||
run: echo "arch=$(uname -m)" >> $GITHUB_ENV | ||
|
||
- name: Create control files | ||
shell: bash | ||
run: | | ||
cat > packaging/deb/miden-node/DEBIAN/control << EOF | ||
Package: miden-node | ||
Version: ${{ inputs.gitref }} | ||
Section: base | ||
Priority: optional | ||
Architecture: $(uname -m) | ||
Architecture: ${{ env.arch }} | ||
Maintainer: Polygon Devops <[email protected]> | ||
Description: miden-node binary package | ||
Homepage: https://polygon.technology/polygon-miden | ||
|
@@ -79,15 +76,30 @@ runs: | |
Version: ${{ inputs.gitref }} | ||
Section: base | ||
Priority: optional | ||
Architecture: $(uname -m) | ||
Architecture: ${{ env.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters