Skip to content

Commit 656e443

Browse files
committed
Compress artifact binaries as tgz
- Old artifact name convention: "norouter-$(uname -s)-$(uname -m)" - New artifact name convention: "norouter-$(uname -s)-$(uname -m).tgz" The archive contains "norouter" executable. On Windows, "norouter-$(uname -s)-$(uname -m).zip" contains "norouter.exe". Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
1 parent 3cbf277 commit 656e443

File tree

8 files changed

+85
-60
lines changed

8 files changed

+85
-60
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: make cross
2727
- name: "SHA256SUMS"
2828
working-directory: go/src/github.com/norouter/norouter
29-
run: ( cd ./bin; sha256sum norouter-* ) | tee /tmp/SHA256SUMS
29+
run: ( cd ./artifacts; sha256sum norouter-* ) | tee /tmp/SHA256SUMS
3030
- name: "The sha256sum of the SHA256SUMS file"
3131
run: sha256sum /tmp/SHA256SUMS
3232
- name: "Prepare the release note"
@@ -42,16 +42,14 @@ jobs:
4242
4343
#### Install
4444
\`\`\`
45-
curl -o norouter --fail -L https://github.com/${{ github.repository }}/releases/download/${tag}/norouter-\$(uname -s)-\$(uname -m)
46-
chmod +x norouter
45+
curl -fsSL https://github.com/${{ github.repository }}/releases/download/${tag}/norouter-\$(uname -s)-\$(uname -m).tgz | sudo tar xzvC /usr/local/bin
4746
\`\`\`
4847
4948
#### About the binaries
5049
The binaries were built automatically on GitHub Actions.
51-
See the log to verify SHA256SUMS.
52-
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
50+
The build log is available for 90 days: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
5351
54-
The sha256sum of the SHA256SUMS file itself is ${shasha} .
52+
The sha256sum of the SHA256SUMS file itself is \`${shasha}\` .
5553
EOF
5654
- name: "Create release"
5755
working-directory: go/src/github.com/norouter/norouter
@@ -60,5 +58,5 @@ jobs:
6058
run: |
6159
tag="${GITHUB_REF##*/}"
6260
asset_flags=()
63-
for f in ./bin/* /tmp/SHA256SUMS; do asset_flags+=("-a" "$f"); done
61+
for f in ./artifacts/* /tmp/SHA256SUMS; do asset_flags+=("-a" "$f"); done
6462
hub release create "${asset_flags[@]}" -F /tmp/release-note.txt --draft "${tag}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/bin
2+
/artifacts
23
/docs.source/public
34
/docs.source/resources
45
/docs.source/node_modules

Makefile

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
GO := go
44

5+
GO_BUILD := GO111MODULE=on CGO_ENABLED=0 $(GO) build -ldflags="-s -w"
6+
7+
TARFLAGS := --owner=0 --group=0
8+
59
binary: bin/norouter
610

711
install:
@@ -11,23 +15,45 @@ uninstall:
1115
rm -f /usr/local/bin/norouter
1216

1317
bin/norouter:
14-
CGO_ENABLED=0 $(GO) build -o $@ ./cmd/norouter
18+
rm -f $@$(shell go env GOEXE)
19+
$(GO_BUILD) -o $@$(shell go env GOEXE) ./cmd/norouter
1520
if [ $(shell go env GOOS) = linux ]; then LANG=C LC_ALL=C file $@ | grep -qw "statically linked"; fi
1621

17-
# The file name convention for Unix: ./bin/norouter-$(uname -s)-$(uname -m)
22+
# The file name convention for Unix: ./artifacts/norouter-$(uname -s)-$(uname -m).tgz
23+
# The file name convention has changed in v0.6.0.
1824
cross:
19-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -o ./bin/norouter-Linux-x86_64 ./cmd/norouter
20-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GO) build -o ./bin/norouter-Linux-aarch64 ./cmd/norouter
21-
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GO) build -o ./bin/norouter-Darwin-x86_64 ./cmd/norouter
22-
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 $(GO) build -o ./bin/norouter-FreeBSD-amd64 ./cmd/norouter
23-
CGO_ENABLED=0 GOOS=netbsd GOARCH=amd64 $(GO) build -o ./bin/norouter-NetBSD-amd64 ./cmd/norouter
24-
CGO_ENABLED=0 GOOS=openbsd GOARCH=amd64 $(GO) build -o ./bin/norouter-OpenBSD-amd64 ./cmd/norouter
25-
CGO_ENABLED=0 GOOS=dragonfly GOARCH=amd64 $(GO) build -o ./bin/norouter-DragonFly-x86_64 ./cmd/norouter
26-
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GO) build -o ./bin/norouter-Windows-x64.exe ./cmd/norouter
25+
rm -rf bin artifacts
26+
mkdir -p artifacts
27+
28+
GOOS=linux GOARCH=amd64 make binary
29+
tar czvf artifacts/norouter-Linux-x86_64.tgz $(TARFLAGS) -C bin norouter
30+
31+
GOOS=linux GOARCH=arm64 make binary
32+
tar czvf artifacts/norouter-Linux-aarch64.tgz $(TARFLAGS) -C bin norouter
33+
34+
GOOS=darwin GOARCH=amd64 make binary
35+
tar czvf artifacts/norouter-Darwin-x86_64.tgz $(TARFLAGS) -C bin norouter
36+
37+
GOOS=freebsd GOARCH=amd64 make binary
38+
tar czvf artifacts/norouter-FreeBSD-amd64.tgz $(TARFLAGS) -C bin norouter
39+
40+
GOOS=netbsd GOARCH=amd64 make binary
41+
tar czvf artifacts/norouter-NetBSD-amd64.tgz $(TARFLAGS) -C bin norouter
42+
43+
GOOS=openbsd GOARCH=amd64 make binary
44+
tar czvf artifacts/norouter-OpenBSD-amd64.tgz $(TARFLAGS) -C bin norouter
45+
46+
GOOS=dragonfly GOARCH=amd64 make binary
47+
tar czvf artifacts/norouter-DragonFly-x86_64.tgz $(TARFLAGS) -C bin norouter
48+
49+
GOOS=windows GOARCH=amd64 make binary
50+
zip -X -j artifacts/norouter-Windows-x64.zip bin/norouter.exe
2751

28-
clean:
2952
rm -rf bin
3053

54+
clean:
55+
rm -rf bin artifacts
56+
3157
integration:
3258
./integration/test-agent.sh
3359
./integration/test-integration.sh

cmd/norouter/show_installer.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,41 @@ echo "# Destination: ${bindir}/norouter"
4949
mkdir -p "${bindir}"
5050
5151
download(){
52-
local="$1"
52+
local="$1"
5353
remote="$2"
5454
echo "# Downloading ${remote}"
5555
if command -v curl >/dev/null 2>&1; then
5656
( set -x; curl -fL -o "$local" "$remote" )
5757
elif command -v wget >/dev/null 2>&1; then
58-
( set -x; wget -O "$local" "$remote" )
59-
else
60-
echo >&2 "curl or wget needs to be installed"
58+
( set -x; wget -O "$local" "$remote" )
59+
else
60+
echo >&2 "curl or wget needs to be installed"
6161
exit 1
6262
fi
6363
}
6464
65-
fname="norouter-$(uname -s)-$(uname -m)"
65+
fname="norouter-$(uname -s)-$(uname -m).tgz"
6666
tmp=$(mktemp -d)
6767
download "${tmp}/${fname}" "https://github.com/norouter/norouter/releases/download/v${version}/${fname}"
68-
chmod +x "${tmp}/${fname}"
6968
download "${tmp}/SHA256SUMS" "https://github.com/norouter/norouter/releases/download/v${version}/SHA256SUMS"
7069
7170
if command -v sha256sum &> /dev/null; then
72-
(
73-
cd "${tmp}"
71+
(
72+
cd "${tmp}"
7473
echo "# Printing sha256sum of SHA256SUMS file itself"
7574
sha256sum SHA256SUMS
7675
echo "# Checking SHA256SUMS"
77-
grep "${fname}" SHA256SUMS | sha256sum -c -
76+
grep "${fname}" SHA256SUMS | sha256sum -c -
77+
echo "# Extracting norouter executable"
78+
tar xzvf "${fname}"
7879
)
7980
fi
8081
if [ -x "${bindir}/norouter" ]; then
81-
echo "# Removing existing ${bindir}/norouter"
82-
rm -f "${bindir}/norouter"
82+
echo "# Removing existing ${bindir}/norouter"
83+
rm -f "${bindir}/norouter"
8384
fi
84-
echo "# Installing ${fname} onto ${bindir}/norouter"
85-
mv "${tmp}/${fname}" "${bindir}/norouter"
85+
echo "# Installing ${tmp}/norouter onto ${bindir}/norouter"
86+
mv "${tmp}/norouter" "${bindir}/norouter"
8687
8788
rm -rf "${tmp}"
8889

docs.source/content/en/docs/Command reference/norouter-show-installer.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,27 @@ weight: 41
66

77
`norouter show-install` the installer script to replicate the same version of `norouter` binary to other hosts.
88

9+
The binary is located as `~/bin/norouter`.
10+
911
## Examples
1012

1113
Show the installer script:
1214

1315
```console
1416
$ norouter show-installer
1517
#!/bin/sh
16-
set -eux
18+
set -eu
1719
# Installation script for NoRouter
1820
# NOTE: make sure to use the same version across all the hosts.
19-
version="0.3.0"
20-
bindir="$HOME/bin"
21-
mkdir -p "${bindir}"
22-
rm -f "${bindir}/norouter"
23-
curl -o "${bindir}/norouter" --fail -L https://github.com/norouter/norouter/releases/download/v${version}/norouter-$(uname -s)-$(uname -m)
24-
chmod +x "${bindir}/norouter"
25-
echo "Successfully installed ${bindir}/norouter (version ${version})"
21+
...
2622
```
2723

2824
Inject the script to a remote SSH host:
2925

3026
```console
3127
$ norouter show-installer | ssh some-user@example.com
3228
...
33-
Successfully installed /home/some-user/bin/norouter (version 0.3.0)
29+
Successfully installed /home/some-user/bin/norouter (version 0.6.0)
3430
```
3531

3632
## norouter show-installer --help

docs.source/content/en/docs/Command reference/norouter.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Show the NoRouter version:
3737

3838
```console
3939
$ norouter -v
40-
norouter version 0.3.0
40+
norouter version 0.6.0
4141
```
4242

4343
## norouter --help
@@ -50,22 +50,21 @@ USAGE:
5050
norouter [global options] command [command options] [arguments...]
5151
5252
VERSION:
53-
0.3.0
53+
0.6.0
5454
5555
DESCRIPTION:
56+
NoRouter is the easiest multi-host & multi-cloud networking ever.
57+
And yet, NoRouter does not require any privilege such as `sudo` or `docker run --privileged`.
5658
57-
NoRouter is the easiest multi-host & multi-cloud networking ever.
58-
And yet, NoRouter does not require any privilege such as `sudo` or `docker run --privileged`.
59-
60-
NoRouter implements unprivileged networking by using multiple loopback addresses such as 127.0.42.101 and 127.0.42.102.
61-
The hosts in the network are connected by forwarding packets over stdio streams like `ssh`, `docker exec`, `podman exec`, `kubectl exec`, and whatever.
62-
63-
Quick usage:
64-
- Install the `norouter` binary to all the hosts. Run `norouter show-installer` to show an installation script.
65-
- Create a manifest YAML file. Run `norouter show-example` to show an example manifest.
66-
- Run `norouter <FILE>` to start NoRouter with the specified manifest YAML file.
67-
68-
Documentation: https://github.com/norouter/norouter
59+
NoRouter implements unprivileged networking by using multiple loopback addresses such as 127.0.42.101 and 127.0.42.102.
60+
The hosts in the network are connected by forwarding packets over stdio streams like `ssh`, `docker exec`, `podman exec`, `kubectl exec`, and whatever.
61+
62+
Quick usage:
63+
- Install the `norouter` binary to all the hosts. Run `norouter show-installer` to show an installation script.
64+
- Create a manifest YAML file. Run `norouter show-example` to show an example manifest.
65+
- Run `norouter <FILE>` to start NoRouter with the specified manifest YAML file.
66+
67+
Web site: https://norouter.io
6968
7069
COMMANDS:
7170
manager, m manager (default subcommand)

docs.source/content/en/docs/Getting started/download.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ Download from https://github.com/norouter/norouter/releases .
1414
Or copy the following script to a terminal:
1515

1616
```bash
17-
curl -o norouter --fail -L https://github.com/norouter/norouter/releases/latest/download/norouter-$(uname -s)-$(uname -m)
18-
chmod +x norouter
17+
curl -fsSL https://github.com/norouter/norouter/releases/latest/download/norouter-$(uname -s)-$(uname -m).tgz | sudo tar xzvC /usr/local/bin
1918
```
2019

2120
{{% alert %}}
@@ -24,6 +23,12 @@ chmod +x norouter
2423
Make sure to use the (almost) same version of NoRouter across all the hosts.
2524
{{% /alert %}}
2625

26+
{{% alert %}}
27+
**Note**
28+
29+
The URL has changed in NoRouter v0.6.0.
30+
{{% /alert %}}
31+
2732
## Already have a norouter binary?
2833

2934
When `norouter` is already installed on the local host, the `norouter show-installer` command can be used to replicate the

docs.source/content/en/docs/Getting started/first-example.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,19 @@ The easiest way is to download the binary on the local host first, and then use
2626
`norouter show-installer | ssh <USER>@<HOST>` to replicate the binary.
2727

2828
```console
29-
$ curl -o norouter --fail -L https://github.com/norouter/norouter/releases/latest/download/norouter-$(uname -s)-$(uname -m)
30-
$ chmod +x norouter
29+
$ curl -fsSL https://github.com/norouter/norouter/releases/latest/download/norouter-$(uname -s)-$(uname -m).tgz | sudo tar xzvC /usr/local/bin
3130
```
3231

3332
```console
3433
$ norouter show-installer | ssh some-user@host1.cloud1.example.com
3534
...
36-
Successfully installed /home/some-user/bin/norouter (version 0.3.0)
35+
Successfully installed /home/some-user/bin/norouter (version 0.6.0)
3736
```
3837

3938
```console
4039
$ norouter show-installer | ssh some-user@host2.cloud2.example.com
4140
...
42-
Successfully installed /home/some-user/bin/norouter (version 0.3.0)
41+
Successfully installed /home/some-user/bin/norouter (version 0.6.0)
4342
```
4443

4544
## Step 1: Create a manifest

0 commit comments

Comments
 (0)