-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Eoracle/develop
DEV-v0.0.7
- Loading branch information
Showing
11 changed files
with
2,942 additions
and
15 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
* @uri-lightblocks @fbaralle @ArielLaub @RonTuretzky |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Enforce Branch Name | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
enforce_branch_name: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check Branch Name | ||
run: | | ||
regular_branch_pattern='^DEV-[0-9]{3,}.*$' | ||
hotfix_branch_pattern='^HF-.*$' | ||
branch_name=$(echo $GITHUB_REF | sed 's/refs\/heads\///') | ||
if [[ ! $branch_name =~ $regular_zranch_patter && ! $branch_name =~ $hotfix_branch_pattern ]]; then | ||
echo "Branch name $branch_name does not match the required patterns." | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Operator CLI Build | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
go_build: | ||
name: Operator CLI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- name: Setup Go Environment | ||
uses: actions/setup-go@v5 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3.0.0 | ||
|
||
- name: Build Operator CLI | ||
run: | | ||
make build-oprcli-arm64 | ||
make build-oprcli-amd64 | ||
- name: 'Reproduce Builds' | ||
run: | | ||
cp bin/oprcli-arm64 bin/oprcli-arm64-1 | ||
cp bin/oprcli-amd64 bin/oprcli-amd64-1 | ||
make build-oprcli-arm64 | ||
make build-oprcli-amd64 | ||
buildsha1=$(shasum -a256 ./oprcli-arm64-1 | awk '{print $1}') | ||
buildsha2=$(shasum -a256 ./oprcli-arm64 | awk '{print $1}') | ||
echo "Arm64 Build 1 SHA: $buildsha1" | ||
echo "Arm64 Build 2 SHA: $buildsha2" | ||
if [ "$buildsha1" != "$buildsha2" ]; then | ||
echo "Arm64 build artifact does not match original" | ||
exit 1 | ||
else | ||
echo "Arm64 Build artifact matches original" | ||
fi | ||
buildsha1=$(shasum -a256 ./oprcli-amd64-1 | awk '{print $1}') | ||
buildsha2=$(shasum -a256 ./oprcli-amd64 | awk '{print $1}') | ||
echo "Amd64 Build 1 SHA: $buildsha1" | ||
echo "Amd64 Build 2 SHA: $buildsha2" | ||
if [ "$buildsha1" != "$buildsha2" ]; then | ||
echo "Amd64 build artifact does not match original" | ||
exit 1 | ||
else | ||
echo "Amd64 Build artifact matches original" | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches-ignore: | ||
- '**' | ||
tags: | ||
- 'v*.*.*' | ||
# to be used by fork patch-releases ^^ | ||
- 'v*.*.*-*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_CONFIG: $HOME/.docker | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Go Environment | ||
uses: actions/setup-go@v5 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3.0.0 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Run GoReleaser build | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: build --clean --parallelism 3 --config build/.goreleaser-operatorcli.yml | ||
|
||
- name: Check if the release already exists | ||
id: check_release | ||
run: | | ||
if gh release view ${{ github.ref_name }} 2>/dev/null; then | ||
echo "::set-output name=exists::true" | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Delete existing release | ||
if: steps.check_release.outputs.exists == 'true' | ||
run: gh release delete ${{ github.ref_name }} -y | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run GoReleaser Release | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --clean --parallelism 3 --config build/.goreleaser-operatorcli.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Save docker digest by tag | ||
id: docker_digest_bytag | ||
run: | | ||
opr_cli_amd64=$(docker inspect eoracle/opr_cli:${{ github.ref_name }}-amd64 | jq -r '.[].RepoDigests[]') | ||
opr_cli_arm64=$(docker inspect eoracle/opr_cli:${{ github.ref_name }}-arm64 | jq -r '.[].RepoDigests[]') | ||
echo "eoracle/opr_cli:${{ github.ref_name }}-amd64: $opr_cli_amd64" > dockers_digest.txt | ||
echo "eoracle/opr_cli:${{ github.ref_name }}-arm64: $opr_cli_arm64" >> dockers_digest.txt | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update docker latest tag if needed | ||
run: | | ||
NEW_TAG="${{ github.ref_name }}" | ||
HIGHEST_TAG=$(git tag | sort -V | tail -n 1) | ||
if [ "$NEW_TAG" == "$HIGHEST_TAG" ]; then | ||
export DOCKER_CLI_EXPERIMENTAL=enabled | ||
docker tag eoracle/opr_cli:${{ github.ref_name }}-amd64 eoracle/opr_cli:latest-amd64 | ||
docker tag eoracle/opr_cli:${{ github.ref_name }}-arm64 eoracle/opr_cli:latest-arm64 | ||
docker push eoracle/opr_cli:latest-amd64 | ||
docker push eoracle/opr_cli:latest-arm64 | ||
docker manifest create eoracle/opr_cli:latest \ | ||
--amend eoracle/opr_cli:latest-amd64 \ | ||
--amend eoracle/opr_cli:latest-arm64 | ||
docker manifest push eoracle/opr_cli:latest | ||
opr_cli_amd64=$(docker inspect eoracle/opr_cli:latest-amd64 | jq -r '.[].RepoDigests[]') | ||
opr_cli_arm64=$(docker inspect eoracle/opr_cli:latest-arm64 | jq -r '.[].RepoDigests[]') | ||
echo "eoracle/opr_cli:latest-amd64: $opr_cli_amd64" > dockers_digest.txt | ||
echo "eoracle/opr_cli:latest-arm64: $opr_cli_arm64" >> dockers_digest.txt | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload Docker digest file to GitHub release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: dockers_digest.txt |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# If you prefer the allow list template instead of the deny list, see community template: | ||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore | ||
# | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
bin/ | ||
dist/ | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
# Go workspace file | ||
go.work | ||
|
||
# Project files | ||
.keystore | ||
.DS_Store | ||
|
||
# Docker configuration | ||
.docker |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Oops, something went wrong.