Skip to content

Commit

Permalink
Merge pull request #492 from gohornet/develop
Browse files Browse the repository at this point in the history
Release 0.4.0
  • Loading branch information
muXxer authored Jun 5, 2020
2 parents 1516c73 + 2f12ca7 commit 8f64f7f
Show file tree
Hide file tree
Showing 366 changed files with 26,318 additions and 16,379 deletions.
13 changes: 10 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
latest-export.gz.bin
latest-export.bin
export.bin
export_comnet.bin
.github
.git
Dockerfile
DOCKER.md
docker/
mainnetdb/
comnetdb/
snapshot/
README.md
.dockerignore
docker-compose.yml
layer*.csv
coordinator.state
coordinator.tree
34 changes: 34 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!---
Hints for a successful PR:
1. It is recommended that before you submit a PR to this repository, to open an issue first and assign yourself.
This way you may get inputs and discover parallel PRs to the one you want to submit.
2. In case of a big PR, consider breaking it up to smaller PRs. This will help getting it merged in an incremental process.
3. Note that a PR should have a *single* area of responsibility. If your PR does more than one thing than it should be split to several PRs!!!!!
-->

# Description

Please include a summary of the change. Include the motivation for the change.

Fixes #(issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation Fix

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have tested my code extensively
- [ ] I have selected the `develop` branch as the target branch
29 changes: 18 additions & 11 deletions .github/workflows/build_HORNET.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
name: Build HORNET
on: [push, pull_request]
jobs:
on:
push:
branches:
- master
- develop
pull_request:

jobs:
build:
name: Build HORNET
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13.5
id: go
- name: Print Go version
run: go version

- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Build HORNET
run: go build -v .
- name: Build HORNET
run: go build -v .
8 changes: 4 additions & 4 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Build Docker
on:
push:
paths:
- "Dockerfile"
- "docker/Dockerfile"
- "docker-compose.yml"
pull_request:
paths:
- "Dockerfile"
- "docker/Dockerfile"
- "docker-compose.yml"

jobs:
Expand All @@ -15,10 +15,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Build HORNET Docker image
run: docker build . --file Dockerfile --tag hornet:latest
run: docker build . --file docker/Dockerfile --tag hornet:latest

- name: Test HORNET Docker image
run: docker run --rm --name hornet hornet:latest --help 2>/dev/null | grep -q "help requested"
18 changes: 18 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: GolangCIlint

on: [pull_request]

jobs:
golangci-lint:
name: GolangCI-Lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: golangci-lint
uses: docker://reviewdog/action-golangci-lint:v1.4.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
golangci_lint_flags: "--timeout=10m"
reporter: "github-pr-review"
28 changes: 14 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ name: Release
on:
release:
types: [published]

jobs:
Release:
name: Release
runs-on: [ubuntu-latest]
container:
image: iotmod/goreleaser-cgo-cross-compiler:1.13.5-musl
image: iotmod/goreleaser-cgo-cross-compiler:1.14.3
volumes: [/repo]

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Docker login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- name: Release HORNET
run: goreleaser --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Docker login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- name: Release HORNET
run: goreleaser --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/test_HORNET.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test HORNET
on:
push:
branches:
- master
- develop
pull_request:

jobs:
test:
name: Test HORNET
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Print Go version
run: go version

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Test HORNET
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 3
command: go test ./...
4 changes: 2 additions & 2 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
name: Test release
runs-on: [ubuntu-latest]
container:
image: iotmod/goreleaser-cgo-cross-compiler:1.13.5-musl
image: iotmod/goreleaser-cgo-cross-compiler:1.14.3
volumes: [/repo]

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Test HORNET Release
run: goreleaser --snapshot --skip-publish --rm-dist
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

# Database directory
mainnetdb/
comnetdb/

# OSX related files
.DS_Store
/hornet

# snapshot files
*export.gz.bin
*export.bin
*export_comnet.bin

# template files
*node_modules
Expand All @@ -31,3 +33,15 @@ plugins/monitor/tanglemonitor

# dist packages
dist/

# Snapshot directory (for docker running in main path)
snapshot/

# log files
hornet.log

# coordinator files
layer*.csv
coordinator.state
coordinator.tree
hive.go/
68 changes: 32 additions & 36 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,12 @@ builds:
- linux
goarch:
- amd64
# Linux ARM(v7) statically linked
- id: hornet-linux-arm
binary: hornet
env:
- CGO_ENABLED=1
- CC=/etc/musl/armv7l-linux-musleabihf-cross/bin/armv7l-linux-musleabihf-gcc-9.2.1
ldflags:
- -s -w -X github.com/gohornet/hornet/plugins/cli.AppVersion={{.Version}}
- -w -extldflags "-static"
flags:
- -tags=pow_c
main: main.go
goos:
- linux
goarch:
- arm
goarm:
- 7
# Linux ARM64 statically linked
- id: hornet-linux-arm64
binary: hornet
env:
- CGO_ENABLED=1
- CC=/etc/musl/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc-9.2.1
- CC=aarch64-linux-musl-gcc
ldflags:
- -s -w -X github.com/gohornet/hornet/plugins/cli.AppVersion={{.Version}}
- -w -extldflags "-static"
Expand All @@ -73,6 +55,18 @@ builds:
- windows
goarch:
- amd64
# macOS AMD64
- id: hornet-macOS-amd64
binary: hornet
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/gohornet/hornet/plugins/cli.AppVersion={{.Version}}
main: main.go
goos:
- darwin
goarch:
- amd64

# Docker
dockers:
Expand All @@ -84,7 +78,8 @@ dockers:
- "gohornet/hornet:{{ .Tag }}"
binaries:
- hornet
dockerfile: Dockerfile.goreleaser
dockerfile: docker/Dockerfile.goreleaser
skip_push: auto

# Archives
archives:
Expand All @@ -96,55 +91,56 @@ archives:
name_template: "{{.ProjectName}}-{{.Version}}_{{.Os}}_{{.Arch}}"
replacements:
amd64: x86_64
386: 32bit
arm: ARM
arm64: ARM64
darwin: macOS
linux: Linux
windows: Windows
openbsd: OpenBSD
netbsd: NetBSD
freebsd: FreeBSD
dragonfly: DragonFlyBSD
files:
- README.md
- LICENSE
- config.json
- neighbors.json
- config_comnet.json
- peering.json
- profiles.json
- mqtt_config.json

# DEB and RPM packages
nfpms:
- id: nfpm
package_name: hornet
file_name_template: '{{ tolower .ProjectName }}_{{ replace .Version "v" "" }}_{{ .Arch }}'
vendor: HORNET
maintainer: HORNET
description: HORNET is a lightweight alternative to IOTA's fullnode software “IRI”.
vendor: GoReleaser
license: Apache 2.0
maintainer: GoHORNET
homepage: https://github.com/gohornet/hornet
description: HORNET is a powerful IOTA fullnode software.
formats:
- deb
- rpm
bindir: /usr/bin
files:
"nfpm/shared_files/hornet.service": "/lib/systemd/system/hornet.service"
"nfpm/shared_files/download_snapshot.sh": "/usr/bin/hornet_download_snapshot.sh"
config_files:
"config.json": "/etc/hornet/config.json"
"neighbors.json": "/etc/hornet/neighbors.json"
"config.json": "/var/lib/hornet/config.json"
"config_comnet.json": "/var/lib/hornet/config_comnet.json"
"mqtt_config.json": "/var/lib/hornet/mqtt_config.json"
"peering.json": "/var/lib/hornet/peering.json"
"profiles.json": "/var/lib/hornet/profiles.json"
"nfpm/shared_files/hornet.env": "/etc/default/hornet"
dependencies:
- systemd
- wget
- bash
scripts:
preremove: "nfpm/deb_files/prerm"
postremove: "nfpm/deb_files/postrm"
preinstall: "nfpm/deb_files/preinst"
postinstall: "nfpm/deb_files/postinst"
replacements:
arm: armhf
overrides:
rpm:
replacements:
amd64: x86_64
name_template: "{{ tolower .ProjectName }}-{{ .Version }}-{{ .Arch }}"
file_name_template: "{{ tolower .ProjectName }}-{{ .Version }}-{{ .Arch }}"
scripts:
preinstall: "nfpm/rpm_files/preinst"
postinstall: "nfpm/rpm_files/postinst"
Expand Down
Loading

0 comments on commit 8f64f7f

Please sign in to comment.