Skip to content

Commit

Permalink
Prepare first release
Browse files Browse the repository at this point in the history
  • Loading branch information
mzampetakis committed Feb 16, 2024
1 parent 7c66087 commit 33892e7
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 9 deletions.
11 changes: 6 additions & 5 deletions .concourse/release-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
source:
uri: https://seed.radicle.gr/zyMFFgrGTswVFj1X9uJrVwEV8EWu.git
branch: main
tag_filter: v*
git_config:
- name: safe.directory
value: /tmp/build/get
Expand Down Expand Up @@ -65,11 +66,11 @@ jobs:
- -c
- |
cd github-actions-adapter
COMMIT_HASH=$(git rev-parse HEAD)
env GOOS=linux GOARCH=amd64 go build -o=../binaries/radicle-github-actions-adapter-linux-amd64-$COMMIT_HASH ./cmd/github-actions-adapter
env GOOS=linux GOARCH=arm64 go build -o=../binaries/radicle-github-actions-adapter-linux-arm64-$COMMIT_HASH ./cmd/github-actions-adapter
env GOOS=darwin GOARCH=amd64 go build -o=../binaries/radicle-github-actions-adapter-darwin-amd64-$COMMIT_HASH ./cmd/github-actions-adapter
env GOOS=darwin GOARCH=arm64 go build -o=../binaries/radicle-github-actions-adapter-darwin-arm64-$COMMIT_HASH ./cmd/github-actions-adapter
GIT_TAG=$(git describe --tags)
env GOOS=linux GOARCH=amd64 go build -ldflags "-X 'radicle-github-actions-adapter/pkg/version.Version=$GIT_TAG' -X 'radicle-github-actions-adapter/pkg/version.BuildTime=$(shell date)'" -o=../binaries/radicle-github-actions-adapter-linux-amd64-$GIT_TAG ./cmd/github-actions-adapter
env GOOS=linux GOARCH=arm64 go build -ldflags "-X 'radicle-github-actions-adapter/pkg/version.Version=$GIT_TAG' -X 'radicle-github-actions-adapter/pkg/version.BuildTime=$(shell date)'" -o=../binaries/radicle-github-actions-adapter-linux-arm64-$GIT_TAG ./cmd/github-actions-adapter
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'radicle-github-actions-adapter/pkg/version.Version=$GIT_TAG' -X 'radicle-github-actions-adapter/pkg/version.BuildTime=$(shell date)'" -o=../binaries/radicle-github-actions-adapter-darwin-amd64-$GIT_TAG ./cmd/github-actions-adapter
env GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'radicle-github-actions-adapter/pkg/version.Version=$GIT_TAG' -X 'radicle-github-actions-adapter/pkg/version.BuildTime=$(shell date)'" -o=../binaries/radicle-github-actions-adapter-darwin-arm64-$GIT_TAG ./cmd/github-actions-adapter
ls -alh ../binaries
# push images
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Changelog

All notable changes for every released version of this project will be documented in this file.
Check [Changelog Format](#Changelog-Format) for more details about this changelog's format.

## [Unreleased]

## [0.5.0] - 2024-02-16

### Added

- Configure through env vars
- Support multiple GitHub Actions monitoring
- Support add comments on patch with information for the GitHub Actions information and results

## Changelog Format

Title: **Version (vX.Y.Z) -Date (YYYY-MM-DD)**

Version numbering follows the [Semantic Versioning](https://semver.org/spec/v2.0.0.html) schema.
You can expect the following sections under each version:

* Added: for new features.
* Changed: for changes in existing functionality.
* Deprecated: for soon-to-be removed features.
* Removed: for now removed features.
* Fixed: for any bug fixes.
* Security: in case of vulnerabilities.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test/cover:
## build: build the cmd/rest application
.PHONY: build
build:
go build -o=/tmp/bin/radicle-github-actions-adapter ./cmd/github-actions-adapter
go build -ldflags "-X 'radicle-github-actions-adapter/pkg/version.Version=development' -X 'radicle-github-actions-adapter/pkg/version.BuildTime=$(shell date)'" -o=/tmp/bin/radicle-github-actions-adapter ./cmd/github-actions-adapter

## run: run the cmd/rest application
.PHONY: run
Expand Down
6 changes: 4 additions & 2 deletions cmd/github-actions-adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ func main() {
flag.Parse()

if *showVersion {
fmt.Printf("version: %s\n", version.Get())
fmt.Printf("version: %s, build_time: %s, revision: %s\n", version.GetVersion(), version.GetBuildTime(),
version.GetRevision())
os.Exit(0)
}

Expand Down Expand Up @@ -108,7 +109,8 @@ func run(logger *slog.Logger) error {
ctx := context.WithValue(context.Background(), app.EventUUIDKey, eventUUID)
ctx = context.WithValue(ctx, app.RepoClonePathKey, eventUUID)

logger.Info("radicle-github-actions-adapter is starting", "version", version.Get())
logger.Info("radicle-github-actions-adapter is starting", "version", version.GetVersion(),
"revision", version.GetRevision(), "build_time", version.GetBuildTime())
radicleBroker := readerwriterbroker.NewReaderWriterBroker(os.Stdin, os.Stdout, logger)
gitOps := git.NewGit(logger)
gitHubOps := github.NewGitHub(cfg.GitHubPAT, logger)
Expand Down
13 changes: 12 additions & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import (
"runtime/debug"
)

func Get() string {
var Version = "development"
var BuildTime = ""

func GetRevision() string {
var revision string
var modified bool
bi, ok := debug.ReadBuildInfo()
Expand All @@ -29,3 +32,11 @@ func Get() string {
}
return revision
}

func GetVersion() string {
return Version
}

func GetBuildTime() string {
return BuildTime
}

0 comments on commit 33892e7

Please sign in to comment.