-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
109 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
name: E2E tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/**" | ||
- "**.go" | ||
- "**/config.yaml" | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
- name: Fmt | ||
run: go fmt ./... | ||
- name: Vet | ||
run: go vet ./... | ||
- name: Test | ||
run: go test ./... | ||
# name: E2E tests | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# branches: | ||
# - main | ||
# paths: | ||
# - ".github/**" | ||
# - "**.go" | ||
# - "**/config.yaml" | ||
# jobs: | ||
# test: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Set up Go | ||
# uses: actions/setup-go@v4 | ||
# with: | ||
# go-version: "1.21" | ||
# - name: Fmt | ||
# run: go fmt ./... | ||
# - name: Vet | ||
# run: go vet ./... | ||
# - name: Test | ||
# run: go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: Release Artifacts | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- main | ||
env: | ||
REGISTRY: harbor.clyso.com | ||
jobs: | ||
|
@@ -11,9 +11,9 @@ jobs: | |
strategy: | ||
matrix: | ||
service: | ||
- worker | ||
# - worker | ||
- proxy | ||
- agent | ||
# - agent | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -34,78 +34,77 @@ jobs: | |
push: true | ||
tags: | | ||
${{ env.REGISTRY }}/chorus/${{ matrix.service }}:${{ github.ref_name }} | ||
${{ env.REGISTRY }}/chorus/${{ matrix.service }}:latest | ||
build-args: | | ||
GIT_TAG=${{ github.ref_name }} | ||
GIT_COMMIT=${{ github.sha }} | ||
SERVICE=${{ matrix.service }} | ||
# publish helm chart | ||
helm: | ||
needs: docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: read chart version | ||
id: chartVer | ||
uses: mikefarah/[email protected] | ||
with: | ||
cmd: yq '.version' deploy/chorus/Chart.yaml | ||
- name: Install helm | ||
uses: azure/[email protected] | ||
- name: Publish chart | ||
run: | | ||
echo "${{ steps.chartVer.outputs.result }}" | ||
helm registry login -u '${{ secrets.DOCKER_USER }}' -p ${{ secrets.DOCKER_PASSWORD }} ${{ env.REGISTRY }} | ||
helm package ./deploy/chorus --app-version=${{ github.ref_name }} | ||
helm push ./chorus-${{ steps.chartVer.outputs.result }}.tgz oci://${{ env.REGISTRY }}/chorus | ||
# publish github Release | ||
release: | ||
needs: helm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
- name: Install zip | ||
uses: montudor/action-zip@v1 | ||
- name: Build standalone binaries | ||
run: | | ||
mkdir standalone | ||
platforms=("darwin/amd64" "darwin/arm64" "linux/386" "linux/amd64" "linux/arm64" "windows/amd64" "windows/386" ) | ||
for platform in "${platforms[@]}" | ||
do | ||
platform_split=(${platform//\// }) | ||
GOOS=${platform_split[0]} | ||
GOARCH=${platform_split[1]} | ||
bin_name='chorus' | ||
output_name='standalone_'${{ github.ref_name }}'_'$GOOS'_'$GOARCH | ||
if [ $GOOS = "windows" ]; then | ||
bin_name+='.exe' | ||
output_name+='.zip' | ||
else | ||
output_name+='.tar.gz' | ||
fi | ||
env GOOS=$GOOS GOARCH=$GOARCH go build -o $bin_name ./cmd/chorus | ||
if [ $? -ne 0 ]; then | ||
echo 'An error has occurred! Aborting the script execution...' | ||
exit 1 | ||
fi | ||
if [ $GOOS = "windows" ]; then | ||
zip -r standalone/$output_name ./$bin_name | ||
else | ||
tar -cvzf standalone/$output_name ./$bin_name | ||
fi | ||
rm ./$bin_name | ||
done | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro' | ||
distribution: goreleaser | ||
version: v1.25.1 | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BREW_RELEASE_TOKEN: ${{ secrets.BREW_RELEASE_TOKEN }} | ||
# helm: | ||
# needs: docker | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: read chart version | ||
# id: chartVer | ||
# uses: mikefarah/[email protected] | ||
# with: | ||
# cmd: yq '.version' deploy/chorus/Chart.yaml | ||
# - name: Install helm | ||
# uses: azure/[email protected] | ||
# - name: Publish chart | ||
# run: | | ||
# echo "${{ steps.chartVer.outputs.result }}" | ||
# helm registry login -u '${{ secrets.DOCKER_USER }}' -p ${{ secrets.DOCKER_PASSWORD }} ${{ env.REGISTRY }} | ||
# helm package ./deploy/chorus --app-version=${{ github.ref_name }} | ||
# helm push ./chorus-${{ steps.chartVer.outputs.result }}.tgz oci://${{ env.REGISTRY }}/chorus | ||
# # publish github Release | ||
# release: | ||
# needs: helm | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/setup-go@v4 | ||
# with: | ||
# go-version: "1.21" | ||
# - name: Install zip | ||
# uses: montudor/action-zip@v1 | ||
# - name: Build standalone binaries | ||
# run: | | ||
# mkdir standalone | ||
# platforms=("darwin/amd64" "darwin/arm64" "linux/386" "linux/amd64" "linux/arm64" "windows/amd64" "windows/386" ) | ||
# for platform in "${platforms[@]}" | ||
# do | ||
# platform_split=(${platform//\// }) | ||
# GOOS=${platform_split[0]} | ||
# GOARCH=${platform_split[1]} | ||
# bin_name='chorus' | ||
# output_name='standalone_'${{ github.ref_name }}'_'$GOOS'_'$GOARCH | ||
# if [ $GOOS = "windows" ]; then | ||
# bin_name+='.exe' | ||
# output_name+='.zip' | ||
# else | ||
# output_name+='.tar.gz' | ||
# fi | ||
# env GOOS=$GOOS GOARCH=$GOARCH go build -o $bin_name ./cmd/chorus | ||
# if [ $? -ne 0 ]; then | ||
# echo 'An error has occurred! Aborting the script execution...' | ||
# exit 1 | ||
# fi | ||
# if [ $GOOS = "windows" ]; then | ||
# zip -r standalone/$output_name ./$bin_name | ||
# else | ||
# tar -cvzf standalone/$output_name ./$bin_name | ||
# fi | ||
# rm ./$bin_name | ||
# done | ||
# | ||
# - name: Run GoReleaser | ||
# uses: goreleaser/goreleaser-action@v5 | ||
# with: | ||
# # either 'goreleaser' (default) or 'goreleaser-pro' | ||
# distribution: goreleaser | ||
# version: v1.25.1 | ||
# args: release --clean | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# BREW_RELEASE_TOKEN: ${{ secrets.BREW_RELEASE_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters