Skip to content

Commit 62ae8e4

Browse files
committed
manual testing pass
0 parents  commit 62ae8e4

24 files changed

+2264
-0
lines changed

.github/release-drafter.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
2+
name-template: 'v$NEXT_PATCH_VERSION 🌈'
3+
tag-template: 'v$NEXT_PATCH_VERSION'
4+
version-template: $MAJOR.$MINOR.$PATCH
5+
# Emoji reference: https://gitmoji.carloscuesta.me/
6+
categories:
7+
- title: '🚀 Features'
8+
labels:
9+
- 'feature'
10+
- 'enhancement'
11+
- 'kind/feature'
12+
- title: '🐛 Bug Fixes'
13+
labels:
14+
- 'fix'
15+
- 'bugfix'
16+
- 'bug'
17+
- 'regression'
18+
- 'kind/bug'
19+
- title: 📝 Documentation updates
20+
labels:
21+
- documentation
22+
- 'kind/doc'
23+
- title: 👻 Maintenance
24+
labels:
25+
- chore
26+
- dependencies
27+
- 'kind/chore'
28+
- 'kind/dep'
29+
- title: 🚦 Tests
30+
labels:
31+
- test
32+
- tests
33+
exclude-labels:
34+
- reverted
35+
- no-changelog
36+
- skip-changelog
37+
- invalid
38+
autolabeler:
39+
- label: 'documentation'
40+
title:
41+
- '/docs:/i'
42+
- label: 'chore'
43+
title:
44+
- '/chore:/i'
45+
- label: 'bug'
46+
title:
47+
- '/fix:/i'
48+
- label: 'enhancement'
49+
title:
50+
- '/feat:/i'
51+
change-template: '* $TITLE (#$NUMBER) @$AUTHOR'
52+
template: |
53+
## What’s Changed
54+
55+
$CHANGES
56+
57+
## Thanks to
58+
$CONTRIBUTORS

.github/workflows/build.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build
2+
3+
on:
4+
- pull_request
5+
6+
jobs:
7+
Test:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- name: Set up Go
11+
uses: actions/setup-go@v3
12+
with:
13+
go-version: 1.22.x
14+
- uses: actions/[email protected]
15+
- name: Unit Test
16+
run: |
17+
make test
18+
19+
Build:
20+
runs-on: ubuntu-20.04
21+
steps:
22+
- name: Set up Go
23+
uses: actions/setup-go@v3
24+
with:
25+
go-version: 1.22.x
26+
- uses: actions/[email protected]
27+
- name: Run GoReleaser
28+
uses: goreleaser/goreleaser-action@v6
29+
with:
30+
version: '~> v2'
31+
args: release --clean --snapshot
32+
33+
BuildImage:
34+
runs-on: ubuntu-20.04
35+
steps:
36+
- uses: actions/[email protected]
37+
- name: Image
38+
run: make build-image
39+
40+
RunE2E:
41+
runs-on: ubuntu-20.04
42+
steps:
43+
- uses: actions/[email protected]
44+
- name: Run e2e
45+
run: |
46+
sudo curl -L https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
47+
sudo chmod u+x /usr/local/bin/docker-compose
48+
make run-e2e

.github/workflows/release-drafter.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
UpdateReleaseDraft:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}

.github/workflows/release.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
branches:
8+
- master
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
REGISTRY_DOCKERHUB: docker.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
Test:
17+
runs-on: ubuntu-20.04
18+
steps:
19+
- name: Set up Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: 1.22.x
23+
- uses: actions/[email protected]
24+
- name: Unit Test
25+
run: |
26+
make test
27+
28+
goreleaser:
29+
runs-on: ubuntu-20.04
30+
if: github.ref != 'refs/heads/master'
31+
steps:
32+
- name: Checkout
33+
uses: actions/[email protected]
34+
with:
35+
fetch-tags: true
36+
fetch-depth: 0
37+
- name: Set output
38+
id: vars
39+
run: echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT
40+
- name: Set up Go
41+
uses: actions/setup-go@v3
42+
with:
43+
go-version: 1.22.x
44+
- name: Image Registry Login
45+
run: |
46+
docker login --username linuxsuren --password ${{secrets.DOCKER_HUB_PUBLISH_SECRETS}}
47+
docker login ${{ env.REGISTRY }}/linuxsuren --username linuxsuren --password ${{secrets.GH_PUBLISH_SECRETS}}
48+
- name: Run GoReleaser
49+
uses: goreleaser/goreleaser-action@v6
50+
with:
51+
version: '~> v2'
52+
args: release --clean
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}
55+
- name: Upload via oras
56+
run: |
57+
export TAG=${{ steps.vars.outputs.tag }}
58+
cd dist
59+
oras push ${{ env.REGISTRY_DOCKERHUB }}/linuxsuren/atest-ext-store-elasticsearch:${TAG#v} */*
60+
oras push ${{ env.REGISTRY }}/linuxsuren/atest-ext-store-elasticsearch:${TAG#v} */*
61+
62+
image:
63+
runs-on: ubuntu-20.04
64+
steps:
65+
- name: Checkout
66+
uses: actions/[email protected]
67+
- name: Setup Docker buildx
68+
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
69+
- name: Log into registry ${{ env.REGISTRY }}
70+
if: github.event_name != 'pull_request'
71+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
72+
with:
73+
registry: ${{ env.REGISTRY }}
74+
username: ${{ github.actor }}
75+
password: ${{ secrets.GH_PUBLISH_SECRETS }}
76+
- name: Log into registry ${{ env.REGISTRY_DOCKERHUB }}
77+
if: github.event_name != 'pull_request'
78+
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
79+
with:
80+
registry: ${{ env.REGISTRY_DOCKERHUB }}
81+
username: linuxsuren
82+
password: ${{ secrets.DOCKER_HUB_PUBLISH_SECRETS }}
83+
- name: Extract Docker metadata
84+
id: meta
85+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
86+
with:
87+
images: |
88+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
89+
${{ env.REGISTRY_DOCKERHUB }}/${{ env.IMAGE_NAME }}
90+
- name: Build and push Docker image
91+
id: build-and-push
92+
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
93+
with:
94+
context: .
95+
push: ${{ github.event_name != 'pull_request' }}
96+
tags: ${{ steps.meta.outputs.tags }}
97+
labels: ${{ steps.meta.outputs.labels }}
98+
platforms: linux/amd64,linux/arm64
99+
cache-from: type=gha
100+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage.out
2+
bin/
3+
.idea/

.goreleaser.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
before:
4+
hooks:
5+
# You may remove this if you don't use go modules.
6+
- go mod tidy
7+
builds:
8+
- env:
9+
- CGO_ENABLED=0
10+
id: atest-store-elasticsearch
11+
binary: atest-store-elasticsearch
12+
goos:
13+
- linux
14+
- windows
15+
- darwin
16+
ignore:
17+
- goarch: 386
18+
ldflags:
19+
- -w
20+
- -s
21+
- -X github.com/linuxsuren/api-testing/pkg/version.version={{.Version}} -X github.com/linuxsuren/api-testing/pkg/version.commit={{.Commit}} -X github.com/linuxsuren/api-testing/pkg/version.date={{.Date}}
22+
archives:
23+
- name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
24+
builds:
25+
- atest-store-elasticsearch
26+
format_overrides:
27+
- goos: windows
28+
format: zip
29+
files:
30+
- README.md
31+
checksum:
32+
name_template: 'checksums.txt'
33+
snapshot:
34+
name_template: "{{ incpatch .Version }}-next"
35+
changelog:
36+
sort: asc
37+
filters:
38+
exclude:
39+
- '^docs:'
40+
- '^test:'

0 commit comments

Comments
 (0)