Skip to content

Commit 355caef

Browse files
Fix indentation
1 parent e3aefd1 commit 355caef

File tree

2 files changed

+46
-30
lines changed

2 files changed

+46
-30
lines changed

.github/actions/build_package/action.yml

+37-21
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,19 @@ runs:
1212
id: git-sha
1313
shell: bash
1414
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
2121
else
2222
echo "::error Unknown git reference type"
23-
# exit 1
23+
exit 1
2424
fi
2525
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-
3126
- name: Create package directories
27+
shell: bash
3228
run: |
3329
mkdir -p \
3430
packaging/deb/miden-node/DEBIAN \
@@ -44,13 +40,9 @@ runs:
4440
packaging/deb/miden-faucet/etc/miden\
4541
packaging/deb/miden-faucet/opt/miden/miden-faucet
4642
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-
5243
# These have to be downloaded as the current repo source isn't necessarily the target git reference.
5344
- name: Copy package install scripts
45+
shell: bash
5446
run: |
5547
git show ${{ steps.git-sha.outputs.sha }}:packaging/miden-node.service > packaging/deb/miden-node/lib/systemd/system/miden-node.service
5648
git show ${{ steps.git-sha.outputs.sha }}:packaging/postinst > packaging/deb/miden-node/DEBIAN/postinst
@@ -59,14 +51,23 @@ runs:
5951
git show ${{ steps.git-sha.outputs.sha }}:packaging/postinst > packaging/deb/miden-faucet/DEBIAN/postinst
6052
git show ${{ steps.git-sha.outputs.sha }}:packaging/postrm > packaging/deb/miden-faucet/DEBIAN/postrm
6153
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.
6262
- name: Create control files
63+
shell: bash
6364
run: |
6465
cat > packaging/deb/miden-node/DEBIAN/control << EOF
6566
Package: miden-node
66-
Version: ${{ inputs.gitref }}
67+
Version: 0
6768
Section: base
6869
Priority: optional
69-
Architecture: $(uname -m)
70+
Architecture: ${{ env.arch }}
7071
Maintainer: Polygon Devops <devops@polygon.technology>
7172
Description: miden-node binary package
7273
Homepage: https://polygon.technology/polygon-miden
@@ -76,18 +77,33 @@ runs:
7677
7778
cat > packaging/deb/miden-faucet/DEBIAN/control << EOF
7879
Package: miden-faucet
79-
Version: ${{ inputs.gitref }}
80+
Version: 0
8081
Section: base
8182
Priority: optional
82-
Architecture: $(uname -m)
83+
Architecture: ${{ env.arch }}
8384
Maintainer: Polygon Devops <devops@polygon.technology>
8485
Description: miden-faucet binary package
8586
Homepage: https://polygon.technology/polygon-miden
8687
Vcs-Git: git@github.com:0xPolygonMiden/miden-node.git
8788
Vcs-Browser: https://github.com/0xPolygonMiden/miden-node
8889
EOF
8990
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+
90105
- name: Build packages
106+
shell: bash
91107
run: |
92108
dpkg-deb --build --root-owner-group packaging/deb/miden-node
93109
dpkg-deb --build --root-owner-group packaging/deb/miden-faucet

.github/workflows/package.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Release packages
2-
run-name: Release packaging for ${{ env.version }}
2+
run-name: Release packaging for ${{ inputs.version || github.ref }}
33

44
env:
55
version: ${{ inputs.version || github.ref }}
@@ -21,10 +21,11 @@ permissions:
2121

2222
jobs:
2323
package:
24-
matrix:
25-
os: [ubuntu-latest, ubuntu22-arm-4core]
24+
strategy:
25+
matrix:
26+
runner: [ubuntu-latest, ubuntu22-arm-4core]
2627
runs-on:
27-
labels: ${{ matrix.os }}
28+
labels: ${{ matrix.runner }}
2829
steps:
2930
# Note that this checkout is _not_ used as the source for the package.
3031
# Instead this is required to access the workflow actions. Package source
@@ -35,16 +36,15 @@ jobs:
3536
fetch-depth: 0
3637

3738
- name: Build packages
38-
uses: ./.github/actions/build_packages
39+
uses: ./.github/actions/build_package
3940
with:
4041
gitref: ${{ env.version }}
4142

4243
- name: Package names
43-
env:
44-
arch: $(uname -m)
4544
run: |
46-
echo "node-package=$(echo miden-node-${{ env.version }}-${{ env.arch }}.deb") >> $GITHUB_ENV
47-
echo "faucet-package=$(echo miden-faucet-${{ env.version }}-${{ env.arch }}.deb") >> $GITHUB_ENV
45+
arch=$(uname -m)
46+
echo "node-package=miden-node-${{ env.version }}-$arch.deb" >> $GITHUB_ENV
47+
echo "faucet-package=miden-faucet-${{ env.version }}-$arch.deb" >> $GITHUB_ENV
4848
4949
- name: Rename package files
5050
run: |

0 commit comments

Comments
 (0)