From 75e70285e67aff576cbe5a3f3a730ec906c5d042 Mon Sep 17 00:00:00 2001
From: Luca Moser <moser.luca@gmail.com>
Date: Wed, 15 Jan 2020 13:38:44 +0100
Subject: [PATCH] Removes TravisCI in favor of GitHub workflows and adds
 GoReleaser (#116)

* remove travis in favor of github workflows

* adjust release repository name

* Update .github/workflows/build.yml

Co-Authored-By: Wolfgang Welz <welzwo@gmail.com>

* Update .github/workflows/build.yml

Co-Authored-By: Wolfgang Welz <welzwo@gmail.com>

* Update .github/workflows/release.yml

Co-Authored-By: Wolfgang Welz <welzwo@gmail.com>

* changes according to Wolfgang's review

* removes id from step in test.yml

* only run twice up on PR open

* Update .github/workflows/test.yml

Co-Authored-By: Wolfgang Welz <welzwo@gmail.com>

Co-authored-by: Wolfgang Welz <welzwo@gmail.com>
---
 .github/ISSUE_TEMPLATE/bug_report.md      |  33 +++++++
 .github/ISSUE_TEMPLATE/feature_request.md |  20 +++++
 .github/workflows/release.yml             |  21 +++++
 .github/workflows/test.yml                |  22 +++++
 .goreleaser.yml                           | 102 ++++++++++++++++++++++
 .travis.yml                               |  18 ----
 6 files changed, 198 insertions(+), 18 deletions(-)
 create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md
 create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md
 create mode 100644 .github/workflows/release.yml
 create mode 100644 .github/workflows/test.yml
 create mode 100644 .goreleaser.yml
 delete mode 100644 .travis.yml

diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..ca1e5995
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,33 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ""
+labels: bug
+assignees: ''
+
+---
+
+<!--- Remove text and sections that do not apply -->
+<!--- Please anonymize personal data such as IP addresses --> 
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+- Go to ...
+- Edit config to ...
+- See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Environment information:**
+ - OS: [e.g. Ubuntu 18.04]
+ - RAM: [e.g. 4 GB]
+ - Cores: [e.g. 4 Cores]
+ - Type: [e.g. Raspberry Pi 3B+, VPS, ...]
+ - GoShimmer version [e.g. 0.2.1]
+
+**Additional context**
+Add any other context about the problem here [e.g. GoShimmer logs, errors, screenshots]
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 00000000..139d1fa5
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ""
+labels: feature
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..cee5c81c
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,21 @@
+name: Release
+
+on:
+  release:
+    types: [published]
+  
+jobs:
+  Release:
+    name: Release
+    runs-on: [ubuntu-latest]
+    container:
+      image: iotmod/goreleaser-cgo-cross-compiler:1.13.5
+      volumes: [/repo]
+
+    steps:
+    - name: Check out code into the Go module directory
+      uses: actions/checkout@v2
+    - name: Release GoShimmer
+      run: goreleaser --rm-dist
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000..35389be9
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,22 @@
+name: Test GoShimmer
+on:
+  push:
+  pull_request:
+    types: [opened, reopened]
+jobs:
+
+  build:
+    name: Test GoShimmer
+    runs-on: ubuntu-latest
+    steps:
+
+    - name: Set up Go 1.13
+      uses: actions/setup-go@v1
+      with:
+        go-version: 1.13.x
+
+    - name: Check out code into the Go module directory
+      uses: actions/checkout@v2
+
+    - name: Run Tests
+      run: make test
diff --git a/.goreleaser.yml b/.goreleaser.yml
new file mode 100644
index 00000000..3d250a15
--- /dev/null
+++ b/.goreleaser.yml
@@ -0,0 +1,102 @@
+# Documentation at http://goreleaser.com
+
+# Project name
+project_name: GoShimmer
+
+# Environment variables
+env:
+  - GO111MODULE=on
+
+# Builds
+builds:
+  # macOS AMD64
+  - id: goshimmer-darwin-amd64
+    binary: goshimmer
+    env:
+      - CGO_ENABLED=1
+      - CC=o64-clang
+      - CXX=o64-clang++
+    ldflags:
+      - -s -w -X github.com/iotaledger/goshimmer/plugins/cli.AppVersion={{.Version}}
+    flags:
+      - -tags=pow_avx
+    main: main.go
+    goos:
+      - darwin
+    goarch:
+      - amd64
+  # Linux AMD64
+  - id: goshimmer-linux-amd64
+    binary: goshimmer
+    env:
+      - CGO_ENABLED=1
+    ldflags:
+      - -s -w -X github.com/iotaledger/goshimmer/plugins/cli.AppVersion={{.Version}}
+    flags:
+      - -tags=pow_avx
+    main: main.go
+    goos:
+      - linux
+    goarch:
+      - amd64
+  # Windows AMD64
+  - id: goshimmer-windows-amd64
+    binary: goshimmer
+    env:
+      - CGO_ENABLED=1
+      - CC=x86_64-w64-mingw32-gcc
+      - CXX=x86_64-w64-mingw32-g++
+    ldflags:
+      - -s -w -X github.com/iotaledger/goshimmer/plugins/cli.AppVersion={{.Version}}
+    flags:
+      - -tags=pow_avx
+    main: main.go
+    goos:
+      - windows
+    goarch:
+      - amd64
+
+# Archives
+archives:
+  - format: tar.gz
+    wrap_in_directory: true
+    format_overrides:
+      - goos: windows
+        format: zip
+    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
+
+# Checksum
+checksum:
+  name_template: "checksums.txt"
+
+# Snapshot
+snapshot:
+  name_template: "{{ .Tag }}"
+
+# Changelog
+changelog:
+  skip: true
+
+# Release
+release:
+  prerelease: auto
+  name_template: "{{.ProjectName}}-{{.Version}}"
+  github:
+    owner: iotaledger
+    name: goshimmer
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index ee06a55b..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-os: linux
-language: go
-
-go:
-  - 1.13
-
-cache:
-  directories:
-    - $HOME/gopath/pkg/mod
-
-env:
-  - GO111MODULE=on
-
-# we are using go modules, so there is nothing to install
-install: true
-
-# use the makefile goal for testing
-script: make test
-- 
GitLab