forked from librespeed/speedtest-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from FreedomNetNL/feature/ci
Feature/ci
- Loading branch information
Showing
6 changed files
with
81 additions
and
114 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
builds: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist ${{ !startsWith(github.ref, 'refs/tags/v') && '--snapshot' || '' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Store build | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build | ||
path: dist/* |
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 |
---|---|---|
@@ -1,120 +1,30 @@ | ||
project_name: 'speedtest-go' | ||
#dist: ./out | ||
before: | ||
hooks: | ||
- go mod download | ||
project_name: 'librespeed-go' | ||
|
||
builds: | ||
- main: ./main.go | ||
id: speedtest-backend | ||
binary: speedtest-backend | ||
env: | ||
- env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- -w -s | ||
goos: | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- 386 | ||
- amd64 | ||
- arm | ||
- arm64 | ||
- mips | ||
- mipsle | ||
goarm: | ||
- 5 | ||
- 6 | ||
- 7 | ||
gomips: | ||
- hardfloat | ||
- softfloat | ||
ignore: | ||
- goos: darwin | ||
goarch: 386 | ||
- goos: windows | ||
goarch: arm | ||
- goos: windows | ||
goarch: arm64 | ||
hooks: | ||
post: upx -9 "{{ .Path }}" | ||
- main: ./main.go | ||
id: speedtest-backend-freebsd | ||
binary: speedtest-backend | ||
env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- -w -s | ||
goos: | ||
- freebsd | ||
goarch: | ||
- 386 | ||
- amd64 | ||
- arm | ||
- arm64 | ||
- mips | ||
- mipsle | ||
goarm: | ||
- 5 | ||
- 6 | ||
- 7 | ||
gomips: | ||
- hardfloat | ||
- softfloat | ||
- main: ./main.go | ||
id: speedtest-backend-noupx-linux | ||
binary: speedtest-backend | ||
env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- -w -s | ||
goos: | ||
- linux | ||
goarch: | ||
- mips64 | ||
- mips64le | ||
gomips: | ||
- hardfloat | ||
- softfloat | ||
- main: ./main.go | ||
id: speedtest-backend-noupx-windows-arm64 | ||
binary: speedtest-backend | ||
env: | ||
- CGO_ENABLED=0 | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- -w -s | ||
goos: | ||
- windows | ||
goarch: | ||
- arm | ||
- arm64 | ||
goarm: | ||
- 5 | ||
- 6 | ||
- 7 | ||
|
||
nfpms: | ||
- homepage: https://freedom.nl | ||
description: LibreSpeed-Go backend | ||
maintainer: Freedom Internet DevOps <[email protected]> | ||
license: LGPL 3.0 | ||
vendor: Freedom Internet | ||
contents: | ||
- src: scripts/defaults | ||
dst: /etc/default/librespeed-go | ||
- src: scripts/systemd/librespeed-go.service | ||
dst: /usr/lib/systemd/system/librespeed-go.service | ||
formats: | ||
- deb | ||
- rpm | ||
dependencies: | ||
- systemd | ||
scripts: | ||
postinstall: scripts/postinstall.sh | ||
|
||
archives: | ||
- format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- files: | ||
- README.md | ||
- LICENSE | ||
- settings.toml | ||
checksum: | ||
name_template: 'checksums.txt' | ||
changelog: | ||
skip: false | ||
sort: asc | ||
release: | ||
github: | ||
owner: librespeed | ||
name: speedtest-go | ||
disable: false |
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Set the command-line arguments to pass to the server. | ||
# Due to shell scaping, to pass backslashes for regexes, you need to double | ||
# them (\\d for \d). If running under systemd, you need to double them again | ||
# (\\\\d to mean \d), and escape newlines too. | ||
ARGS="" |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
systemctl daemon-reload | ||
systemctl enable librespeed-go | ||
systemctl start librespeed-go |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=LibreSpeed-Go backend | ||
Documentation=https://github.com/FreedomNetNL/speedtest-go | ||
|
||
[Service] | ||
Restart=on-failure | ||
DynamicUser=yes | ||
User=librespeed | ||
EnvironmentFile=/etc/default/librespeed-go | ||
ExecStart=/usr/local/bin/librespeed-go $ARGS | ||
|
||
[Install] | ||
WantedBy=multi-user.target |