├── go1.11 ├── linter │ ├── entrypoint.sh │ ├── gp-setup.sh │ ├── Dockerfile │ └── gp-linter.sh ├── test │ ├── entrypoint.sh │ ├── gp-setup.sh │ └── Dockerfile └── release │ ├── entrypoint.sh │ ├── gp-setup.sh │ ├── Dockerfile │ └── gp-release.sh ├── go1.12 ├── linter │ ├── entrypoint.sh │ ├── gp-setup.sh │ ├── Dockerfile │ └── gp-linter.sh ├── test │ ├── entrypoint.sh │ ├── gp-setup.sh │ └── Dockerfile └── release │ ├── entrypoint.sh │ ├── gp-setup.sh │ ├── Dockerfile │ └── gp-release.sh ├── go1.13 ├── linter │ ├── entrypoint.sh │ ├── gp-setup.sh │ ├── Dockerfile │ └── gp-linter.sh ├── test │ ├── entrypoint.sh │ ├── gp-setup.sh │ └── Dockerfile └── release │ ├── entrypoint.sh │ ├── gp-setup.sh │ ├── Dockerfile │ └── gp-release.sh ├── go1.19 ├── linter │ ├── entrypoint.sh │ ├── gp-setup.sh │ ├── Dockerfile │ └── gp-linter.sh ├── test │ ├── entrypoint.sh │ ├── gp-setup.sh │ └── Dockerfile └── release │ ├── entrypoint.sh │ ├── gp-setup.sh │ ├── Dockerfile │ └── gp-release.sh ├── test ├── test │ └── test.go ├── main.go ├── go.mod └── go.sum ├── entrypoint.sh ├── setup.sh ├── Dockerfile ├── Makefile ├── .github └── workflows │ └── push.yml ├── install.sh ├── linter.sh ├── release.sh └── README.md /go1.11/linter/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | . /gp-linter.sh 7 | -------------------------------------------------------------------------------- /go1.11/test/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | go test ./... 7 | -------------------------------------------------------------------------------- /go1.12/linter/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | . /gp-linter.sh 7 | -------------------------------------------------------------------------------- /go1.12/test/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | go test ./... 7 | -------------------------------------------------------------------------------- /go1.13/linter/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | . /gp-linter.sh 7 | -------------------------------------------------------------------------------- /go1.13/test/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | go test ./... 7 | -------------------------------------------------------------------------------- /go1.19/linter/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | . /gp-linter.sh 7 | -------------------------------------------------------------------------------- /go1.19/test/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | go test ./... 7 | -------------------------------------------------------------------------------- /go1.11/release/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | . /gp-release.sh 7 | -------------------------------------------------------------------------------- /go1.12/release/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | . /gp-release.sh 7 | -------------------------------------------------------------------------------- /go1.13/release/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | . /gp-release.sh 7 | -------------------------------------------------------------------------------- /go1.19/release/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | . /gp-setup.sh 6 | . /gp-release.sh 7 | -------------------------------------------------------------------------------- /test/test/test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | // Add adds 2 numbers together 4 | func Add(num1 int, num2 int) int { 5 | return num1 + num2 6 | } 7 | -------------------------------------------------------------------------------- /test/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "test-project/test" 6 | ) 7 | 8 | func main() { 9 | result := test.Add(1, 2) 10 | fmt.Printf("result: %+v", result) 11 | } 12 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -exuo pipefail 4 | 5 | cat << EOF 6 | usage: up [--level | -n ][--help][--version] 7 | 8 | Report bugs to: 9 | up home page: 10 | EOF 11 | 12 | exit 1 13 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.11/test/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.12/test/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.13/test/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.19/test/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.11/linter/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.11/release/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.12/linter/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.12/release/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.13/linter/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.13/release/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.19/linter/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /go1.19/release/gp-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -exuo pipefail 3 | 4 | export GO111MODULE=on 5 | 6 | WORK_SPACE=${PROJECT_PATH:-} 7 | 8 | # Set PROJECT_PATH to change your working directory 9 | if [ -z "${WORK_SPACE}" ]; then 10 | WORK_SPACE="." 11 | fi 12 | 13 | cd $WORK_SPACE 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Introduction" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | 15 | ENTRYPOINT ["/entrypoint.sh"] 16 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | ver: 3 | @read -p "Enter a new version:" version; \ 4 | old_version=$(shell grep -o "\d.\d.\d" Dockerfile); \ 5 | echo "$$old_version to $$version"; \ 6 | for i in $(shell find . -name "Dockerfile"); do sed -i "s/$$old_version/$$version/g" $$i; done; 7 | 8 | sync: 9 | cat setup.sh | tee $(shell find . -name "gp-setup.sh") 10 | cat linter.sh | tee $(shell find . -name "gp-linter.sh") 11 | cat release.sh | tee $(shell find . -name "gp-release.sh") 12 | .PHONY: ver sync 13 | -------------------------------------------------------------------------------- /test/go.mod: -------------------------------------------------------------------------------- 1 | module test-project 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/client9/misspell v0.3.4 // indirect 7 | github.com/kisielk/errcheck v1.2.0 // indirect 8 | golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 // indirect 9 | golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2 // indirect 10 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect 11 | golang.org/x/sys v0.0.0-20190913121621-c3b328c6e5a7 // indirect 12 | golang.org/x/text v0.3.2 // indirect 13 | golang.org/x/tools v0.0.0-20190913181337-0240832f5c3d // indirect 14 | ) 15 | -------------------------------------------------------------------------------- /go1.11/test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.11.9-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-setup.sh /gp-setup.sh 15 | 16 | RUN apk add --no-cache curl jq git build-base 17 | ENTRYPOINT ["/entrypoint.sh"] 18 | -------------------------------------------------------------------------------- /go1.12/test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.12.9-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-setup.sh /gp-setup.sh 15 | 16 | RUN apk add --no-cache curl jq git build-base 17 | ENTRYPOINT ["/entrypoint.sh"] 18 | -------------------------------------------------------------------------------- /go1.13/test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.13.4-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-setup.sh /gp-setup.sh 15 | 16 | RUN apk add --no-cache curl jq git build-base 17 | ENTRYPOINT ["/entrypoint.sh"] 18 | -------------------------------------------------------------------------------- /go1.19/test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.19.1-alpine3.16 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-setup.sh /gp-setup.sh 15 | 16 | RUN apk add --no-cache curl jq git build-base 17 | ENTRYPOINT ["/entrypoint.sh"] 18 | -------------------------------------------------------------------------------- /go1.11/linter/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.11.9-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-linter.sh /gp-linter.sh 15 | COPY gp-setup.sh /gp-setup.sh 16 | RUN apk add --no-cache curl jq git build-base 17 | 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /go1.12/linter/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.12.9-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-linter.sh /gp-linter.sh 15 | COPY gp-setup.sh /gp-setup.sh 16 | 17 | RUN apk add --no-cache curl jq git build-base 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /go1.13/linter/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.13.4-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-linter.sh /gp-linter.sh 15 | COPY gp-setup.sh /gp-setup.sh 16 | 17 | RUN apk add --no-cache curl jq git build-base 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /go1.11/release/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.11.9-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-release.sh /gp-release.sh 15 | COPY gp-setup.sh /gp-setup.sh 16 | 17 | RUN apk add --no-cache curl jq git build-base 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /go1.12/release/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.12.9-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-release.sh /gp-release.sh 15 | COPY gp-setup.sh /gp-setup.sh 16 | 17 | RUN apk add --no-cache curl jq git build-base 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /go1.13/release/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.13.4-alpine 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-release.sh /gp-release.sh 15 | COPY gp-setup.sh /gp-setup.sh 16 | 17 | RUN apk add --no-cache curl jq git build-base 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /go1.19/linter/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.19.1-alpine3.16 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-linter.sh /gp-linter.sh 15 | COPY gp-setup.sh /gp-setup.sh 16 | 17 | RUN apk add --no-cache curl jq git build-base 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /go1.19/release/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.19.1-alpine3.16 2 | 3 | LABEL name="Golang Pipeline" 4 | LABEL maintainer="Shoukoo" 5 | LABEL version="0.2.8" 6 | LABEL repository="https://github.com/shoukoo/golang-pipeline" 7 | 8 | LABEL com.github.actions.name="Golang Pipeline" 9 | LABEL com.github.actions.description="Run Golang commands" 10 | LABEL com.github.actions.icon="box" 11 | LABEL com.github.actions.color="blue" 12 | 13 | COPY entrypoint.sh /entrypoint.sh 14 | COPY gp-release.sh /gp-release.sh 15 | COPY gp-setup.sh /gp-setup.sh 16 | 17 | RUN apk add --no-cache curl jq git build-base 18 | ENTRYPOINT ["/entrypoint.sh"] 19 | -------------------------------------------------------------------------------- /.github/workflows/push.yml: -------------------------------------------------------------------------------- 1 | on: 2 | - push 3 | - pull_request 4 | name: build 5 | jobs: 6 | go-pipeline: 7 | name: Go Checks 8 | strategy: 9 | matrix: 10 | version: [ 1.19 ] 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@master 14 | - name: go${{ matrix.version }} linter 15 | uses: ./go${{ matrix.version }}/linter 16 | with: 17 | GOLINT: on 18 | MISSPELL: on 19 | env: 20 | PROJECT_PATH: test 21 | - name: go${{ matrix.version }} test 22 | env: 23 | PROJECT_PATH: test 24 | run: | 25 | ./go${{ matrix.version }}/test 26 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -euo pipefail 4 | 5 | mkdir -p .github/workflows 6 | if [ -f ".github/workflows/push.yml" ]; then 7 | echo ".github/workflows/push.yml already exists!" 8 | exit 1 9 | fi 10 | 11 | cat << EOF > .github/workflows/push.yml 12 | on: push 13 | name: build 14 | jobs: 15 | go-test: 16 | name: Go Test 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@master 20 | - name: go1.12 linters 21 | uses: shoukoo/golang-pipeline/go1.12/linter@master 22 | - name: go1.12 test 23 | uses: shoukoo/golang-pipeline/go1.12/test@master 24 | EOF 25 | 26 | echo "> Created .github/worflows/push.yml" 27 | echo "> Done!" 28 | -------------------------------------------------------------------------------- /linter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | STATICCHECK=${INPUT_STATICCHECK:-on} 6 | ERRCHECK=${INPUT_ERRCHECK:-on} 7 | GOLINT=${INPUT_GOLINT:-off} 8 | GOLINTPATH=${INPUT_GOLINTPATH:-.} 9 | MISSPELL=${INPUT_MISSPELL:-off} 10 | 11 | if [[ $STATICCHECK == "on" ]]; then 12 | # https://www.staticcheck.io/docs/checks 13 | go get honnef.co/go/tools/cmd/staticcheck 14 | staticcheck ./... 15 | fi 16 | 17 | if [[ $GOLINT == "on" ]]; then 18 | # https://github.com/golang/lint 19 | go get -u golang.org/x/lint/golint 20 | golint -set_exit_status=1 ${GOLINTPATH}/... 21 | fi 22 | 23 | if [[ $ERRCHECK == "on" ]]; then 24 | # https://github.com/kisielk/errcheck 25 | go get -u github.com/kisielk/errcheck 26 | errcheck ./... 27 | fi 28 | 29 | if [[ $MISSPELL == "on" ]]; then 30 | # https://github.com/client9/misspell 31 | go get -u github.com/client9/misspell/cmd/misspell 32 | misspell -error $(find . -name "*.go") 33 | fi 34 | -------------------------------------------------------------------------------- /go1.11/linter/gp-linter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | STATICCHECK=${INPUT_STATICCHECK:-on} 6 | ERRCHECK=${INPUT_ERRCHECK:-on} 7 | GOLINT=${INPUT_GOLINT:-off} 8 | GOLINTPATH=${INPUT_GOLINTPATH:-.} 9 | MISSPELL=${INPUT_MISSPELL:-off} 10 | 11 | if [[ $STATICCHECK == "on" ]]; then 12 | # https://www.staticcheck.io/docs/checks 13 | go get honnef.co/go/tools/cmd/staticcheck 14 | staticcheck ./... 15 | fi 16 | 17 | if [[ $GOLINT == "on" ]]; then 18 | # https://github.com/golang/lint 19 | go get -u golang.org/x/lint/golint 20 | golint -set_exit_status=1 ${GOLINTPATH}/... 21 | fi 22 | 23 | if [[ $ERRCHECK == "on" ]]; then 24 | # https://github.com/kisielk/errcheck 25 | go get -u github.com/kisielk/errcheck 26 | errcheck ./... 27 | fi 28 | 29 | if [[ $MISSPELL == "on" ]]; then 30 | # https://github.com/client9/misspell 31 | go get -u github.com/client9/misspell/cmd/misspell 32 | misspell -error $(find . -name "*.go") 33 | fi 34 | -------------------------------------------------------------------------------- /go1.12/linter/gp-linter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | STATICCHECK=${INPUT_STATICCHECK:-on} 6 | ERRCHECK=${INPUT_ERRCHECK:-on} 7 | GOLINT=${INPUT_GOLINT:-off} 8 | GOLINTPATH=${INPUT_GOLINTPATH:-.} 9 | MISSPELL=${INPUT_MISSPELL:-off} 10 | 11 | if [[ $STATICCHECK == "on" ]]; then 12 | # https://www.staticcheck.io/docs/checks 13 | go get honnef.co/go/tools/cmd/staticcheck 14 | staticcheck ./... 15 | fi 16 | 17 | if [[ $GOLINT == "on" ]]; then 18 | # https://github.com/golang/lint 19 | go get -u golang.org/x/lint/golint 20 | golint -set_exit_status=1 ${GOLINTPATH}/... 21 | fi 22 | 23 | if [[ $ERRCHECK == "on" ]]; then 24 | # https://github.com/kisielk/errcheck 25 | go get -u github.com/kisielk/errcheck 26 | errcheck ./... 27 | fi 28 | 29 | if [[ $MISSPELL == "on" ]]; then 30 | # https://github.com/client9/misspell 31 | go get -u github.com/client9/misspell/cmd/misspell 32 | misspell -error $(find . -name "*.go") 33 | fi 34 | -------------------------------------------------------------------------------- /go1.13/linter/gp-linter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | STATICCHECK=${INPUT_STATICCHECK:-on} 6 | ERRCHECK=${INPUT_ERRCHECK:-on} 7 | GOLINT=${INPUT_GOLINT:-off} 8 | GOLINTPATH=${INPUT_GOLINTPATH:-.} 9 | MISSPELL=${INPUT_MISSPELL:-off} 10 | 11 | if [[ $STATICCHECK == "on" ]]; then 12 | # https://www.staticcheck.io/docs/checks 13 | go get honnef.co/go/tools/cmd/staticcheck 14 | staticcheck ./... 15 | fi 16 | 17 | if [[ $GOLINT == "on" ]]; then 18 | # https://github.com/golang/lint 19 | go get -u golang.org/x/lint/golint 20 | golint -set_exit_status=1 ${GOLINTPATH}/... 21 | fi 22 | 23 | if [[ $ERRCHECK == "on" ]]; then 24 | # https://github.com/kisielk/errcheck 25 | go get -u github.com/kisielk/errcheck 26 | errcheck ./... 27 | fi 28 | 29 | if [[ $MISSPELL == "on" ]]; then 30 | # https://github.com/client9/misspell 31 | go get -u github.com/client9/misspell/cmd/misspell 32 | misspell -error $(find . -name "*.go") 33 | fi 34 | -------------------------------------------------------------------------------- /go1.19/linter/gp-linter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | STATICCHECK=${INPUT_STATICCHECK:-on} 6 | ERRCHECK=${INPUT_ERRCHECK:-on} 7 | GOLINT=${INPUT_GOLINT:-off} 8 | GOLINTPATH=${INPUT_GOLINTPATH:-.} 9 | MISSPELL=${INPUT_MISSPELL:-off} 10 | 11 | if [[ $STATICCHECK == "on" ]]; then 12 | # https://www.staticcheck.io/docs/checks 13 | go install honnef.co/go/tools/cmd/staticcheck@latest 14 | staticcheck ./... 15 | fi 16 | 17 | if [[ $GOLINT == "on" ]]; then 18 | # https://github.com/golang/lint 19 | go install golang.org/x/lint/golint@latest 20 | golint -set_exit_status=1 ${GOLINTPATH}/... 21 | fi 22 | 23 | if [[ $ERRCHECK == "on" ]]; then 24 | # https://github.com/kisielk/errcheck 25 | go install github.com/kisielk/errcheck@latest 26 | errcheck ./... 27 | fi 28 | 29 | if [[ $MISSPELL == "on" ]]; then 30 | # https://github.com/client9/misspell 31 | go install github.com/client9/misspell/cmd/misspell@latest 32 | misspell -error $(find . -name "*.go") 33 | fi 34 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | EVENT_DATA=$(cat $GITHUB_EVENT_PATH) 6 | UPLOAD_URL=$(echo $EVENT_DATA | jq -r .release.upload_url) 7 | UPLOAD_URL=${UPLOAD_URL/\{?name,label\}/} 8 | PROJECT_NAME=$(basename $GITHUB_REPOSITORY) 9 | EXT="" 10 | if [ $GOOS == 'windows' ]; then 11 | EXT='.exe' 12 | fi 13 | NAME="${PROJECT_NAME}-${GOOS}-${GOARCH}${EXT}" 14 | 15 | echo "Building $NAME under $GOOS/$GOARCH" 16 | go build -o "${PROJECT_NAME}" 17 | 18 | tar cvfz tmp.tgz "${PROJECT_NAME}" 19 | CHECKSUM=$(sha256sum tmp.tgz | cut -d ' ' -f 1) 20 | 21 | curl \ 22 | --fail \ 23 | -X POST \ 24 | --data-binary @tmp.tgz\ 25 | -H 'Content-Type: application/octet-stream' \ 26 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 27 | "${UPLOAD_URL}?name=${NAME}.tar.gz" 28 | 29 | 30 | curl \ 31 | -X POST \ 32 | --data "$CHECKSUM" \ 33 | -H 'Content-Type: text/plain' \ 34 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 35 | "${UPLOAD_URL}?name=${NAME}_checksum_sha256.txt" 36 | -------------------------------------------------------------------------------- /go1.11/release/gp-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | EVENT_DATA=$(cat $GITHUB_EVENT_PATH) 6 | UPLOAD_URL=$(echo $EVENT_DATA | jq -r .release.upload_url) 7 | UPLOAD_URL=${UPLOAD_URL/\{?name,label\}/} 8 | PROJECT_NAME=$(basename $GITHUB_REPOSITORY) 9 | EXT="" 10 | if [ $GOOS == 'windows' ]; then 11 | EXT='.exe' 12 | fi 13 | NAME="${PROJECT_NAME}-${GOOS}-${GOARCH}${EXT}" 14 | 15 | echo "Building $NAME under $GOOS/$GOARCH" 16 | go build -o "${PROJECT_NAME}" 17 | 18 | tar cvfz tmp.tgz "${PROJECT_NAME}" 19 | CHECKSUM=$(sha256sum tmp.tgz | cut -d ' ' -f 1) 20 | 21 | curl \ 22 | --fail \ 23 | -X POST \ 24 | --data-binary @tmp.tgz\ 25 | -H 'Content-Type: application/octet-stream' \ 26 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 27 | "${UPLOAD_URL}?name=${NAME}.tar.gz" 28 | 29 | 30 | curl \ 31 | -X POST \ 32 | --data "$CHECKSUM" \ 33 | -H 'Content-Type: text/plain' \ 34 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 35 | "${UPLOAD_URL}?name=${NAME}_checksum_sha256.txt" 36 | -------------------------------------------------------------------------------- /go1.12/release/gp-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | EVENT_DATA=$(cat $GITHUB_EVENT_PATH) 6 | UPLOAD_URL=$(echo $EVENT_DATA | jq -r .release.upload_url) 7 | UPLOAD_URL=${UPLOAD_URL/\{?name,label\}/} 8 | PROJECT_NAME=$(basename $GITHUB_REPOSITORY) 9 | EXT="" 10 | if [ $GOOS == 'windows' ]; then 11 | EXT='.exe' 12 | fi 13 | NAME="${PROJECT_NAME}-${GOOS}-${GOARCH}${EXT}" 14 | 15 | echo "Building $NAME under $GOOS/$GOARCH" 16 | go build -o "${PROJECT_NAME}" 17 | 18 | tar cvfz tmp.tgz "${PROJECT_NAME}" 19 | CHECKSUM=$(sha256sum tmp.tgz | cut -d ' ' -f 1) 20 | 21 | curl \ 22 | --fail \ 23 | -X POST \ 24 | --data-binary @tmp.tgz\ 25 | -H 'Content-Type: application/octet-stream' \ 26 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 27 | "${UPLOAD_URL}?name=${NAME}.tar.gz" 28 | 29 | 30 | curl \ 31 | -X POST \ 32 | --data "$CHECKSUM" \ 33 | -H 'Content-Type: text/plain' \ 34 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 35 | "${UPLOAD_URL}?name=${NAME}_checksum_sha256.txt" 36 | -------------------------------------------------------------------------------- /go1.13/release/gp-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | EVENT_DATA=$(cat $GITHUB_EVENT_PATH) 6 | UPLOAD_URL=$(echo $EVENT_DATA | jq -r .release.upload_url) 7 | UPLOAD_URL=${UPLOAD_URL/\{?name,label\}/} 8 | PROJECT_NAME=$(basename $GITHUB_REPOSITORY) 9 | EXT="" 10 | if [ $GOOS == 'windows' ]; then 11 | EXT='.exe' 12 | fi 13 | NAME="${PROJECT_NAME}-${GOOS}-${GOARCH}${EXT}" 14 | 15 | echo "Building $NAME under $GOOS/$GOARCH" 16 | go build -o "${PROJECT_NAME}" 17 | 18 | tar cvfz tmp.tgz "${PROJECT_NAME}" 19 | CHECKSUM=$(sha256sum tmp.tgz | cut -d ' ' -f 1) 20 | 21 | curl \ 22 | --fail \ 23 | -X POST \ 24 | --data-binary @tmp.tgz\ 25 | -H 'Content-Type: application/octet-stream' \ 26 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 27 | "${UPLOAD_URL}?name=${NAME}.tar.gz" 28 | 29 | 30 | curl \ 31 | -X POST \ 32 | --data "$CHECKSUM" \ 33 | -H 'Content-Type: text/plain' \ 34 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 35 | "${UPLOAD_URL}?name=${NAME}_checksum_sha256.txt" 36 | -------------------------------------------------------------------------------- /go1.19/release/gp-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -exuo pipefail 4 | 5 | EVENT_DATA=$(cat $GITHUB_EVENT_PATH) 6 | UPLOAD_URL=$(echo $EVENT_DATA | jq -r .release.upload_url) 7 | UPLOAD_URL=${UPLOAD_URL/\{?name,label\}/} 8 | PROJECT_NAME=$(basename $GITHUB_REPOSITORY) 9 | EXT="" 10 | if [ $GOOS == 'windows' ]; then 11 | EXT='.exe' 12 | fi 13 | NAME="${PROJECT_NAME}-${GOOS}-${GOARCH}${EXT}" 14 | 15 | echo "Building $NAME under $GOOS/$GOARCH" 16 | go build -o "${PROJECT_NAME}" 17 | 18 | tar cvfz tmp.tgz "${PROJECT_NAME}" 19 | CHECKSUM=$(sha256sum tmp.tgz | cut -d ' ' -f 1) 20 | 21 | curl \ 22 | --fail \ 23 | -X POST \ 24 | --data-binary @tmp.tgz\ 25 | -H 'Content-Type: application/octet-stream' \ 26 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 27 | "${UPLOAD_URL}?name=${NAME}.tar.gz" 28 | 29 | 30 | curl \ 31 | -X POST \ 32 | --data "$CHECKSUM" \ 33 | -H 'Content-Type: text/plain' \ 34 | -H "Authorization: Bearer ${GITHUB_TOKEN}" \ 35 | "${UPLOAD_URL}?name=${NAME}_checksum_sha256.txt" 36 | -------------------------------------------------------------------------------- /test/go.sum: -------------------------------------------------------------------------------- 1 | github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= 2 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 3 | github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= 4 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 5 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 6 | golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 7 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 8 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 9 | golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 10 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 11 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 12 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 13 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 14 | golang.org/x/sys v0.0.0-20190913121621-c3b328c6e5a7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 15 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 16 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 17 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 18 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 19 | golang.org/x/tools v0.0.0-20190913181337-0240832f5c3d h1:JG5eBjADEFhCRMAdfzvIYKuT/2E9oOzCDJMqMxD5LVw= 20 | golang.org/x/tools v0.0.0-20190913181337-0240832f5c3d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 21 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # golang-pipeline 4 | > Important! This Github Action only supports Go Module 5 | 6 | ## Quick Install 7 | Run the below command to create a push workflow in your repo. 8 | ```bash 9 | curl -o- https://raw.githubusercontent.com/shoukoo/golang-pipeline/master/install.sh | bash 10 | ``` 11 | 12 | # Workflows 13 | golang-pipeline supports Go version 1.11, 1.12, 1.13, and 1.19 and each version has its tests, linters and release. 14 | 15 | **Format** 16 | ``` 17 | shoukoo/golang-pipeline//@master 18 | ``` 19 | 20 | **Examples** 21 | ``` 22 | # Run linters in Go1.11 23 | shoukoo/golang-pipeline/go1.11/linter@master 24 | # Run test in Go1.12 25 | shoukoo/golang-pipeline/go1.12/test@master 26 | # Run release in Go1.13 27 | shoukoo/golang-pipeline/go1.13/release@master 28 | # Run release in Go1.19 29 | shoukoo/golang-pipeline/go1.19/release@master 30 | ``` 31 | 32 | If your Go project is not located at the root of the repo you can also specify environment variable PROJECT_PATH: 33 | ``` 34 | steps: 35 | - name: go1.12 test 36 | uses: shoukoo/golang-pipeline/go1.12/test@master 37 | env: 38 | PROJECT_PATH: "./my/new/path" 39 | ``` 40 | 41 | # Actions: 42 | ## Linters: 43 | This is the list of linters you can use in your workflow, you can turn them on or off by declaring their key and value in the workflow. 44 | - [**Staticcheck**](https://github.com/dominikh/go-tools#installation) 45 | A collection of tools and libraries for working with Go code, including linters and static analysis, most prominently staticcheck. 46 | - default: on 47 | - key: STATICCHECK 48 | - [**Errcheck**](https://github.com/kisielk/errcheck) 49 | A program for checking for unchecked errors in go programs. 50 | - default: on 51 | - key: ERRCHECK 52 | - [**Golint**](https://github.com/golang/lint) 53 | Golint is more focused with coding style. Golint is in use at Google, and it seeks to match the accepted style of the open source Go project. 54 | - default: off 55 | - key: GOLINT 56 | 57 | Additionally you can override default golint path with 58 | - default: . 59 | - key: GOLINTPATH 60 | - [**Misspell**](https://github.com/client9/misspell) 61 | Correct commonly misspelt English words 62 | - default : off 63 | - key: MISSPELL 64 | 65 | **Example** 66 | ```yaml 67 | on: push 68 | name: build 69 | jobs: 70 | go-pipeline: 71 | name: Go Checks 72 | runs-on: ubuntu-latest 73 | steps: 74 | - name: go1.12 linter 75 | uses: shoukoo/golang-pipeline/go1.12/linter@master 76 | with: 77 | GOLINT: on 78 | GOLINTPATH: pkg/controller 79 | MISSPELL: off 80 | ``` 81 | ## Test: 82 | **Example** 83 | ```yaml 84 | on: push 85 | name: build 86 | jobs: 87 | go-pipeline: 88 | name: Go Checks 89 | runs-on: ubuntu-latest 90 | steps: 91 | - name: go1.12 test 92 | uses: shoukoo/golang-pipeline/go1.12/test@master 93 | ``` 94 | 95 | ## Release: 96 | This action required GOOS, GOARCH and GITHUB_TOKEN env variables for golang-pipeline to build and deploy binary to a release. 97 | - **GOOS** 98 | is the running program's operating system target: one of darwin, freebsd, linux, and so on. 99 | - **GOARCH** 100 | is the running program's architecture target: one of 386, amd64, arm, s390x, and so on. 101 | - **GITHUB_TOKEN** 102 | use this token - `${{ secrets.GITHUB_TOKEN }}` to deploy your build 103 | 104 | **Exmaple**: 105 | ``` yaml 106 | on: release 107 | name: Build on release 108 | jobs: 109 | build: 110 | name: Build Go 111 | runs-on: ubuntu-latest 112 | steps: 113 | - name: osx build 114 | uses: shoukoo/golang-pipeline/go1.12/release@master 115 | if: github.event.action == 'published' 116 | env: 117 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 118 | GOOS: darwin 119 | GOARCH: amd64 120 | - name: windows build 121 | uses: shoukoo/golang-pipeline/go1.12/release@master 122 | if: github.event.action == 'published' 123 | env: 124 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 125 | GOOS: windows 126 | GOARCH: amd64 127 | - name: linux build 128 | uses: shoukoo/golang-pipeline/go1.12/release@master 129 | if: github.event.action == 'published' 130 | env: 131 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 132 | GOOS: linux 133 | GOARCH: amd64 134 | ``` 135 | 136 | ## Self-Promotion 137 | Like golang-pipeline? Follow the repository on [GitHub](https://github.com/shoukoo/golang-pipeline) or follow me on [Twitter](https://twitter.com/shoukoo1) 138 | --------------------------------------------------------------------------------