Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing development and main branch #169

Merged
merged 3 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"

permissions:
contents: write
packages: write

jobs:
release-binaries-github:
name: Release Binaries to Github
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Make release
run: |
make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Clean release folder
run: |
sudo rm -rf dist
104 changes: 104 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
project_name: rubixgoplatform

env:
- CGO_ENABLED=1

before:
hooks:
- go mod tidy -compat=1.20

builds:

- id: ubuntu-amd64
main: ./
binary: rubixgoplatform
env:
- CC=x86_64-linux-gnu-gcc
goos:
- linux
goarch:
- amd64

- id: ubuntu-arm64
main: ./
binary: rubixgoplatform
env:
- CC=aarch64-linux-gnu-gcc
goos:
- linux
goarch:
- arm64

- id: darwin-amd64
main: ./
binary: rubixgoplatform
env:
- CC=o64-clang
- CGO_LDFLAGS=-L/lib
goos:
- darwin
goarch:
- amd64

- id: darwin-arm64
main: ./
binary: rubixgoplatform
env:
- CC=oa64-clang
- CGO_LDFLAGS=-L/lib
goos:
- darwin
goarch:
- arm64

- id: windows-amd64
main: ./
binary: rubixgoplatform
env:
- CC=x86_64-w64-mingw32-gcc
goos:
- windows
goarch:
- amd64

archives:
- id: linux-darwin-archive
builds:
- ubuntu-amd64
- ubuntu-arm64
- darwin-amd64
- darwin-arm64
format: tar.gz
wrap_in_directory: false
name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"

- id: windows-archive
builds:
- windows-amd64
format: zip
wrap_in_directory: false
name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}"

checksum:
name_template: 'checksums.txt'
algorithm: sha256

snapshot:
name_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

release:
github:
owner: rubixchain
name: rubixgoplatform

draft: false
mode: append
header: |
# Release Notes
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,26 @@ compile-mac:
clean:
rm -f linux/rubixgoplatform windows/rubixgoplatform.exe mac/rubixgoplatform

all: compile-linux compile-windows compile-mac
all: compile-linux compile-windows compile-mac

############################ Release ##################################

GORELEASER_VERSION := 1.20
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GORELEASER_VERSION)

# Publish binaries to Gitbub. It is used in `release` Github Action Workflow
ifdef GITHUB_TOKEN
release:
docker run \
--rm \
-e GITHUB_TOKEN=$(GITHUB_TOKEN) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/rubixgoplatform \
-w /go/src/rubixgoplatform \
$(GORELEASER_IMAGE) \
release \
--clean
else
release:
@echo "Error: GITHUB_TOKEN is not defined. Please define it before running 'make release'."
endif