@@ -12,23 +12,19 @@ runs:
12
12
id : git-sha
13
13
shell : bash
14
14
run : |
15
- if git show-ref -q --verify "refs/remotes/origin/$gitref" 2>/dev/null; then
16
- echo "sha=$(git show-ref --hash --verify " refs/remotes/origin/$gitref" )" >> $GITHUB_OUTPUT
17
- elif git show-ref -q --verify "refs/tags/$gitref" 2>/dev/null; then
18
- echo "sha=$(git show-ref --hash --verify " refs/tags/$gitref" )" >> $GITHUB_OUTPUT
19
- elif git rev-parse --verify "$gitref ^{commit}" >/dev/null 2>&1; then
20
- echo "sha=$(git rev-parse --verify "$ gitref^{commit})" >> $GITHUB_OUTPUT
15
+ if git show-ref -q --verify "refs/remotes/origin/${{ inputs. gitref }} " 2>/dev/null; then
16
+ echo "sha=$(git show-ref --hash --verify ' refs/remotes/origin/${{ inputs. gitref }}' )" >> $GITHUB_OUTPUT
17
+ elif git show-ref -q --verify "refs/tags/${{ inputs. gitref }} " 2>/dev/null; then
18
+ echo "sha=$(git show-ref --hash --verify ' refs/tags/${{ inputs. gitref }}' )" >> $GITHUB_OUTPUT
19
+ elif git rev-parse --verify "${{ inputs.gitreff }} ^{commit}" >/dev/null 2>&1; then
20
+ echo "sha=$(git rev-parse --verify '${{ inputs. gitref }} ^{commit}' )" >> $GITHUB_OUTPUT
21
21
else
22
22
echo "::error Unknown git reference type"
23
- # exit 1
23
+ exit 1
24
24
fi
25
25
26
- - name : Build binaries
27
- run : |
28
- cargo install miden-node --locked --features testing --git ${{ github.repositoryUrl }} --rev ${{ steps.git-sha.outputs.sha }}
29
- cargo install miden-faucet --locked --features testing --git ${{ github.repositoryUrl }} --rev ${{ steps.git-sha.outputs.sha }}
30
-
31
26
- name : Create package directories
27
+ shell : bash
32
28
run : |
33
29
mkdir -p \
34
30
packaging/deb/miden-node/DEBIAN \
44
40
packaging/deb/miden-faucet/etc/miden\
45
41
packaging/deb/miden-faucet/opt/miden/miden-faucet
46
42
47
- - name : Copy binary files
48
- run : |
49
- cp -p $CARGO_HOME/bin/miden-node packaging/deb/miden-node/urs/bin/
50
- cp -p $CARGO_HOME/bin/miden-faucet packaging/deb/miden-faucet/urs/bin/
51
-
52
43
# These have to be downloaded as the current repo source isn't necessarily the target git reference.
53
44
- name : Copy package install scripts
45
+ shell : bash
54
46
run : |
55
47
git show ${{ steps.git-sha.outputs.sha }}:packaging/miden-node.service > packaging/deb/miden-node/lib/systemd/system/miden-node.service
56
48
git show ${{ steps.git-sha.outputs.sha }}:packaging/postinst > packaging/deb/miden-node/DEBIAN/postinst
@@ -59,14 +51,23 @@ runs:
59
51
git show ${{ steps.git-sha.outputs.sha }}:packaging/postinst > packaging/deb/miden-faucet/DEBIAN/postinst
60
52
git show ${{ steps.git-sha.outputs.sha }}:packaging/postrm > packaging/deb/miden-faucet/DEBIAN/postrm
61
53
54
+ - name : Platform architecture
55
+ shell : bash
56
+ run : |
57
+ # Control file's architecture field does not allow underscores, so use amd64.
58
+ arch= uname -m | sed "s/x86_64/amd64/"
59
+ echo "arch=$arch" >> $GITHUB_ENV
60
+
61
+ # Its unclear what to set the Version field to for non-tagged values.
62
62
- name : Create control files
63
+ shell : bash
63
64
run : |
64
65
cat > packaging/deb/miden-node/DEBIAN/control << EOF
65
66
Package: miden-node
66
- Version: ${{ inputs.gitref }}
67
+ Version: 0
67
68
Section: base
68
69
Priority: optional
69
- Architecture: $(uname -m)
70
+ Architecture: ${{ env.arch }}
70
71
Maintainer: Polygon Devops <devops@polygon.technology>
71
72
Description: miden-node binary package
72
73
Homepage: https://polygon.technology/polygon-miden
@@ -76,18 +77,33 @@ runs:
76
77
77
78
cat > packaging/deb/miden-faucet/DEBIAN/control << EOF
78
79
Package: miden-faucet
79
- Version: ${{ inputs.gitref }}
80
+ Version: 0
80
81
Section: base
81
82
Priority: optional
82
- Architecture: $(uname -m)
83
+ Architecture: ${{ env.arch }}
83
84
Maintainer: Polygon Devops <devops@polygon.technology>
84
85
Description: miden-faucet binary package
85
86
Homepage: https://polygon.technology/polygon-miden
86
87
Vcs-Git: git@github.com:0xPolygonMiden/miden-node.git
87
88
Vcs-Browser: https://github.com/0xPolygonMiden/miden-node
88
89
EOF
89
90
91
+ - name : Build binaries
92
+ shell : bash
93
+ env :
94
+ repo-url : ${{ github.server_url }}/${{ github.repository }}
95
+ run : |
96
+ cargo install miden-node --root . --locked --features testing --git ${{ env.repo-url }} --rev ${{ steps.git-sha.outputs.sha }}
97
+ cargo install miden-faucet --root . --locked --features testing --git ${{ env.repo-url }} --rev ${{ steps.git-sha.outputs.sha }}
98
+
99
+ - name : Copy binary files
100
+ shell : bash
101
+ run : |
102
+ cp -p ./bin/miden-node packaging/deb/miden-node/usr/bin/
103
+ cp -p ./bin/miden-faucet packaging/deb/miden-faucet/usr/bin/
104
+
90
105
- name : Build packages
106
+ shell : bash
91
107
run : |
92
108
dpkg-deb --build --root-owner-group packaging/deb/miden-node
93
109
dpkg-deb --build --root-owner-group packaging/deb/miden-faucet
0 commit comments