Skip to content

Commit

Permalink
Merge pull request #79 from Umaaz/master
Browse files Browse the repository at this point in the history
change(builds): change builds to use goreleaser
  • Loading branch information
Umaaz committed Feb 8, 2024
2 parents 85b6811 + 02d7d97 commit 8cc7ac1
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 93 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:

steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.x

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup go-junit-report
run: go install github.com/jstemmer/go-junit-report/v2@latest
Expand Down Expand Up @@ -51,33 +51,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.x

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Vendor
run: go mod vendor

- name: Build Deep
run: make deep

- name: Build deep-cli
run: make deep-cli
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: build --clean --snapshot

vendor-check:
name: Vendor check
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.x

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Protoc
uses: arduino/setup-protoc@v1
Expand All @@ -93,12 +94,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.20.x

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- run: go install mvdan.cc/gofumpt@latest
- run: go install golang.org/x/tools/cmd/goimports@latest

Expand Down
81 changes: 24 additions & 57 deletions .github/workflows/on_release.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,39 @@
name: Release
name: goreleaser

on:
release:
types: [ created ]
push:
tags:
- '*'

env:
VERSION: ${{ github.ref_name }}
permissions:
contents: write

jobs:
build:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
- name: Checkout
uses: actions/checkout@v4
with:
go-version: 1.20.x
fetch-depth: 0

- name: Check out code
uses: actions/checkout@v3

- name: Vendor
run: go mod vendor

- name: Build
run: make deep

- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload release binary
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./bin/linux/deep-amd64
asset_name: Linux amd64
asset_content_type: application/octet-stream

docker:
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Check out code
uses: actions/checkout@v3

- name: Build image
run: make docker-deep-ci
- name: Set up Go
uses: actions/setup-go@v5

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Image
run: |
docker tag intergral/deep intergral/deep:$VERSION
docker tag intergral/deep intergral/deep:latest
docker push intergral/deep:$VERSION
docker push intergral/deep:latest
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
10 changes: 5 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
Expand All @@ -35,7 +35,7 @@ jobs:
- run: pip install -r ./docs/requirements.txt
- run: mkdocs build -f ./docs/mkdocs.yml
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: docs/_site

Expand All @@ -48,4 +48,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
98 changes: 84 additions & 14 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json

archives:
- id: default
builds:
- deep

builds:
- id: "deep"
- id: deep
main: ./cmd/deep
binary: deep
env:
Expand Down Expand Up @@ -32,20 +35,87 @@ builds:
- -X main.Branch={{ .Branch }}
- -X main.Revision={{ .ShortCommit }}
- -X main.Version={{ .Version }}
mod_timestamp: '{{ .CommitTimestamp }}'
changelog:
skip: true
sort: asc
filters:
exclude:
- '^.github:'
- '^example:'
- '^integration:'
- '^vendor:'

- id: deep-cli
main: ./cmd/deep-cli
binary: deep-cli
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
- arm
ignore:
- goarch: arm
goos: darwin
- goarch: arm
goos: windows
- goarch: arm64
goos: windows
flags:
- -v
- -trimpath
ldflags:
- -s
- -w
- -X main.Branch={{ .Branch }}
- -X main.Revision={{ .ShortCommit }}
- -X main.Version={{ .Version }}

kos:
- id: deep
main: ./cmd/deep
env:
- CGO_ENABLED=0
platforms:
- linux/amd64
- linux/arm64
flags:
- -v
- -trimpath
ldflags:
- -s
- -w
- -X main.Branch={{ .Branch }}
- -X main.Revision={{ .ShortCommit }}
- -X main.Version={{ .Version }}
repository: intergral
tags:
- latest
- '{{.Version}}'
base_import_paths: true

- id: deep-cli
main: ./cmd/deep-cli
env:
- CGO_ENABLED=0
platforms:
- linux/amd64
- linux/arm64
flags:
- -v
- -trimpath
ldflags:
- -s
- -w
- -X main.Branch={{ .Branch }}
- -X main.Revision={{ .ShortCommit }}
- -X main.Version={{ .Version }}
repository: intergral
tags:
- latest
- '{{.Version}}'
base_import_paths: true

checksum:
name_template: SHA256SUMS

changelog:
disable: true

release:
draft: true
prerelease: auto
snapshot:
name_template: '{{ .Version }}-SNAPSHOT-{{ .ShortCommit }}'
1 change: 0 additions & 1 deletion .idea/deep.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<!-- 1.0.5 START -->
# 1.0.5 (xx/xx/2024)
- **[BUGFIX]**: compactor/retention - missing loop in retention and compactor [#76](https://github.com/intergral/deep/pull/76) [@Umaaz](https://github.com/Umaaz)
<!-- 1.0.5 END -->

<!-- 1.0.4 START -->
# 1.0.4 (04/12/2023)
- **[BUGFIX]**: compactor/retention - missing loop in retention and compactor [#76](https://github.com/intergral/deep/pull/76) [@Umaaz](https://github.com/Umaaz)
<!-- 1.0.4 END -->

<!-- 1.0.3 START -->
# 1.0.3 (xx/xx/2023)
# 1.0.3 (30/11/2023)
- **[CHANGE]**: add/improve monitoring for retention [#75](https://github.com/intergral/deep/pull/75) [@Umaaz](https://github.com/Umaaz)
- **[CHANGE]**: add docs for run books [#74](https://github.com/intergral/deep/pull/74) [@Umaaz](https://github.com/Umaaz)
- **[CHANGE]**: unify metric namespaces and subsystems [#73](https://github.com/intergral/deep/pull/73) [@Umaaz](https://github.com/Umaaz)
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ PROTO_INTERMEDIATE_DIR = pkg/.patched-proto
PROTOC_ARGS=--go_out=${PROTO_INTERMEDIATE_DIR}/out
GRPC_PROTOC_ARGS=--go-grpc_out=${PROTO_INTERMEDIATE_DIR}/out

PROTO_VERSION=$(shell grep -P deep-proto go.mod | cut -d ' ' -f2 | cut -c2-)

.PHONY: gen-proto
gen-proto:
@echo --
Expand All @@ -128,10 +130,11 @@ gen-proto:
find pkg/deeppb -name *.proto | grep -v deep.proto | grep -v frontend.proto | xargs -L 1 -I rm

@echo --
@echo -- Using proto version $(PROTO_VERSION)
@echo -- Copying to $(PROTO_INTERMEDIATE_DIR)
@echo --
git submodule update --init
cd deep-proto && git pull origin master
cd deep-proto && git checkout tags/$(PROTO_VERSION)
mkdir -p $(PROTO_INTERMEDIATE_DIR)
mkdir -p $(PROTO_INTERMEDIATE_DIR)/out
mkdir -p $(PROTO_INTERMEDIATE_DIR)/stats
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/test/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func generateFrames(options GenerateOptions, vars []*tp.Variable) []*tp.StackFra
Children: []*tp.VariableID{
makeSimpleVariable(vars, "max_executions", 31),
makeSimpleVariable(vars, "cnt", 25),
makeSimpleVariable(vars, "started_at", 1682513610601),
makeSimpleVariable(vars, "started_at", int64(1682513610601)),
makeSimpleVariable(vars, "test_name", "This is a test"),
makeVariable(vars, &tp.VariableID{Name: "char_counter"}, &tp.Variable{Type: "dict", Value: "Size: 3", Hash: "140425155619776", Children: []*tp.VariableID{
makeSimpleVariable(vars, "1", 23),
Expand Down

0 comments on commit 8cc7ac1

Please sign in to comment.