diff --git a/.drone.yml b/.drone.yml index 9088792..c559518 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,20 +1,33 @@ --- kind: pipeline type: docker -name: build-linux-amd64 - -environment: - GOOS: linux - GOARCH: amd64 - GOOPTIONS: -mod=vendor - SRCFILES: cmd/g2g/*.go - PROJECTNAME: g2g +name: build-linux steps: - - name: build + - name: build-linux-amd64 image: golang commands: - go build -o $PROJECTNAME $GOOPTIONS $SRCFILES + environment: + GOOS: linux + GOARCH: amd64 + GOOPTIONS: -mod=vendor + SRCFILES: cmd/g2g/*.go + PROJECTNAME: g2g + when: + event: + exclude: + - tag + - name: build-linux-arm64 + image: golang + commands: + - go build -o $PROJECTNAME $GOOPTIONS $SRCFILES + environment: + GOOS: linux + GOARCH: arm64 + GOOPTIONS: -mod=vendor + SRCFILES: cmd/g2g/*.go + PROJECTNAME: g2g when: event: exclude: @@ -23,22 +36,36 @@ steps: --- kind: pipeline type: docker -name: gitea-release-linux-amd64 - -environment: - GOOS: linux - GOARCH: amd64 - GOOPTIONS: -mod=vendor - SRCFILES: cmd/g2g/*.go - PROJECTNAME: g2g +name: gitea-release-linux steps: - - name: build + - name: build-linux-amd64 image: golang commands: - go build -o $PROJECTNAME $GOOPTIONS $SRCFILES - tar -czvf $PROJECTNAME-$DRONE_TAG-$GOOS-$GOARCH.tar.gz $PROJECTNAME - echo $PROJECTNAME $DRONE_TAG > VERSION + environment: + GOOS: linux + GOARCH: amd64 + GOOPTIONS: -mod=vendor + SRCFILES: cmd/g2g/*.go + PROJECTNAME: g2g + when: + event: + - tag + - name: build-linux-arm64 + image: golang + commands: + - go build -o $PROJECTNAME $GOOPTIONS $SRCFILES + - tar -czvf $PROJECTNAME-$DRONE_TAG-$GOOS-$GOARCH.tar.gz $PROJECTNAME + - echo $PROJECTNAME $DRONE_TAG > VERSION + environment: + GOOS: linux + GOARCH: arm64 + GOOPTIONS: -mod=vendor + SRCFILES: cmd/g2g/*.go + PROJECTNAME: g2g when: event: - tag diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 0ec831d..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch", - "type": "go", - "request": "launch", - "mode": "auto", - "program": "${fileDirname}", - "env": {}, - "args": [] - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 8c45cda..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "go.formatTool": "goimports" -} \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index c58a259..0000000 --- a/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# g2g Makefile - -GOCMD=go -GOBUILDCMD=${GOCMD} build -GOOPTIONS=-mod=vendor -ldflags="-s -w" -VERSION := $(shell cat ./VERSION) - -RMCMD=rm -BINNAME=g2g - -SRCFILES=cmd/g2g/*.go - -all: build - -build: - ${GOBUILDCMD} ${GOOPTIONS} ${SRCFILES} - -clean: - ${RMCMD} -f ${BINNAME} diff --git a/ci-build.sh b/ci-build.sh deleted file mode 100755 index b02bd00..0000000 --- a/ci-build.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -set -e - -PROJECTNAME=g2g -RELEASENAME=${PROJECTNAME} -VERSION="0" - -GOOPTIONS="-mod=vendor" -SRCFILES=cmd/g2g/*.go - -build() { - echo "Begin of build" - if [[ ! -z $DRONE_TAG ]] - then - echo "Drone tag set, let's do a release" - VERSION=$DRONE_TAG - echo "${PROJECTNAME} ${VERSION}" > /build/VERSION - elif [[ ! -z $DRONE_TAG ]] - then - echo "Drone not set, let's only do a build" - VERSION=$DRONE_COMMIT - fi - - if [[ ! -z $VERSION && ! -z $GOOS && ! -z $GOARCH ]] - then - echo "Let's set a release name" - RELEASENAME=${PROJECTNAME}-${VERSION}-${GOOS}-${GOARCH} - fi - - echo "Building project" - go build -o ${PROJECTNAME} ${GOOPTIONS} ${SRCFILES} - - if [[ ! -z $DRONE_TAG ]] - then - echo "Let's make archives" - mkdir -p /build - tar -czvf /build/${RELEASENAME}.tar.gz ${PROJECTNAME} - fi - - echo "Removing binary file" - rm ${PROJECTNAME} - - echo "End of build" -} - -clean() { - rm -rf $RELEASEDIR -} - -case $1 in - "build") - build - ;; - "clean") - clean - ;; - *) - echo "No options choosen" - exit 1 - ;; -esac diff --git a/go.mod b/go.mod index 6396b3e..70ac016 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module git.paulbsd.com/paulbsd/g2g -go 1.17 +go 1.19 -require gopkg.in/ini.v1 v1.66.6 +require gopkg.in/ini.v1 v1.67.0 require github.com/stretchr/testify v1.7.0 // indirect diff --git a/go.sum b/go.sum index eeca99c..61c304c 100644 --- a/go.sum +++ b/go.sum @@ -6,9 +6,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c= -gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/gopkg.in/ini.v1/deprecated.go b/vendor/gopkg.in/ini.v1/deprecated.go index e8bda06..48b8e66 100644 --- a/vendor/gopkg.in/ini.v1/deprecated.go +++ b/vendor/gopkg.in/ini.v1/deprecated.go @@ -14,12 +14,9 @@ package ini -const ( +var ( // Deprecated: Use "DefaultSection" instead. DEFAULT_SECTION = DefaultSection -) - -var ( // Deprecated: AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. AllCapsUnderscore = SnackCase ) diff --git a/vendor/gopkg.in/ini.v1/ini.go b/vendor/gopkg.in/ini.v1/ini.go index ac2a93a..99e7f86 100644 --- a/vendor/gopkg.in/ini.v1/ini.go +++ b/vendor/gopkg.in/ini.v1/ini.go @@ -23,15 +23,15 @@ import ( ) const ( - // DefaultSection is the name of default section. You can use this constant or the string literal. - // In most of cases, an empty string is all you need to access the section. - DefaultSection = "DEFAULT" - // Maximum allowed depth when recursively substituing variable names. depthValues = 99 ) var ( + // DefaultSection is the name of default section. You can use this var or the string literal. + // In most of cases, an empty string is all you need to access the section. + DefaultSection = "DEFAULT" + // LineBreak is the delimiter to determine or compose a new line. // This variable will be changed to "\r\n" automatically on Windows at package init time. LineBreak = "\n" diff --git a/vendor/modules.txt b/vendor/modules.txt index 988e1d7..009446f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,5 +1,5 @@ # github.com/stretchr/testify v1.7.0 ## explicit; go 1.13 -# gopkg.in/ini.v1 v1.66.6 +# gopkg.in/ini.v1 v1.67.0 ## explicit gopkg.in/ini.v1