From 5b4d36f8babde3365626be8c4b5997c3fa5edefa Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Wed, 3 Jan 2024 10:39:03 +1100 Subject: [PATCH] adding drone --- .drone.sh | 14 ++++++++++++++ .drone.yml | 27 +++++++++++++++++++++++++++ .gitignore | 0 CHANGELOG.md | 9 +++++++++ VERSION | 1 + 5 files changed, 51 insertions(+) create mode 100644 .drone.sh create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 VERSION diff --git a/.drone.sh b/.drone.sh new file mode 100644 index 0000000..e0dde9d --- /dev/null +++ b/.drone.sh @@ -0,0 +1,14 @@ +#!/bin/sh +#set -e +#set -x + +# disable CGO for cross-compiling +export CGO_ENABLED=0 + +export now=$(TZ=Australia/Sydney date '+%Y%m%d-%H%M%S') +echo $now +echo "build commences" +go build -ldflags "-X main.sha1ver=`git rev-parse HEAD` -X main.buildTime=$now" -o api-tester . +echo "build complete" +sha256sum api-tester > api-tester_checksum.txt +ls -lah \ No newline at end of file diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..3b65aa7 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,27 @@ +kind: pipeline +type: docker +name: default + +# Docs at https://docs.drone.io/pipeline/exec/overview/ +# Also see https://github.com/harness/drone-cli/blob/master/.drone.yml + +steps: +- name: build + image: golang + commands: + - sh ./.drone.sh + +- name: auto-release + image: xena/gitea-release:latest + pull: always + settings: + auth_username: nathan + default_branch: trunk + gitea_server: https://git.coadcorp.com + gitea_token: + from_secret: GITEA_TOKEN + when: + event: + - push + branch: + - main \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0eeec55 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## 0.0.1 + +Initial development \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8a9ecc2 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file