diff --git a/.github/workflows/CICD.yaml b/.github/workflows/CICD.yaml index a380c958..70cfcbd2 100644 --- a/.github/workflows/CICD.yaml +++ b/.github/workflows/CICD.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -24,7 +24,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: Check License @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -56,7 +56,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: Check If We're Up to Date with Everything @@ -79,7 +79,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -88,7 +88,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: Check Auto Generated Files @@ -111,7 +111,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -120,7 +120,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: golangci-lint @@ -145,7 +145,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -154,7 +154,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: Build all @@ -181,7 +181,7 @@ jobs: # runs-on: self-hosted-ubuntu-latest-x64 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -190,7 +190,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: Test ${{ matrix.package }} @@ -233,7 +233,7 @@ jobs: # runs-on: self-hosted-ubuntu-latest-x64 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -242,7 +242,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: Benchmark ${{ matrix.package }} @@ -288,7 +288,7 @@ jobs: # runs-on: self-hosted-ubuntu-latest-x64 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -297,7 +297,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: Set up QEMU @@ -376,9 +376,20 @@ jobs: permissions: write-all steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Find latest Go Version + id: findLatestGoVersion + run: | + LATEST_GO_VERSION=$(make latestGoVersion) + echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" + - name: Setup GO + uses: actions/setup-go@v5 + with: + go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} + - name: Build Artefacts + run: env GOOS=linux env GOARCH=amd64 make buildAllBinaries - name: Compute new Tag version id: compute_tag uses: craig-day/compute-tag@v14 @@ -399,15 +410,17 @@ jobs: NEW_TAG_VERSION: ${{ steps.compute_tag.outputs.next_tag }} - name: Create Release id: create_release - #TODO This needs to be replaced ASAP! https://github.com/actions/create-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.check_tag.outputs.next_tag }} - release_name: ${{ steps.check_tag.outputs.next_tag }} draft: false prerelease: false + fail_on_unmatched_files: true + generate_release_notes: true + make_latest: true + files: | + eskimo.linux.amd64.bin + eskimo-hut.linux.amd64.bin - name: Slack Notification For Failure/Cancellation if: ${{ github.event_name == 'push' && (failure() || cancelled()) }} uses: rtCamp/action-slack-notify@v2 @@ -437,7 +450,7 @@ jobs: # runs-on: self-hosted-ubuntu-latest-x64 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Find latest Go Version @@ -446,7 +459,7 @@ jobs: LATEST_GO_VERSION=$(make latestGoVersion) echo "::set-output name=latestGoVersion::$LATEST_GO_VERSION" - name: Setup GO - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ steps.findLatestGoVersion.outputs.latestGoVersion }} - name: Set up QEMU @@ -506,7 +519,7 @@ jobs: run: | echo "APP_TAG=${{needs.push_docker.outputs.nextTag}}" >> $GITHUB_ENV - name: Checkout the target `master` branch of `secret-infrastructure` - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ice-blockchain/secret-infrastructure ref: master diff --git a/.gitignore b/.gitignore index 68730088..2f4e764c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.exe *.BIN +*.bin *.exe~ *.dll *.so diff --git a/Makefile b/Makefile index d4e06d49..38450a1b 100644 --- a/Makefile +++ b/Makefile @@ -95,8 +95,9 @@ build: build-all@ci/cd binary-specific-service: set -xe; \ - echo "$@: $(SERVICE_NAME) / $(GOARCH)" ; \ + echo "$@: $(SERVICE_NAME) / $(GOOS) / $(GOARCH)" ; \ go build -tags=go_json -a -v -o ./cmd/$${SERVICE_NAME}/bin ./cmd/$${SERVICE_NAME}; \ + cp ./cmd/$${SERVICE_NAME}/bin ./$${SERVICE_NAME}.$${GOOS}.$${GOARCH}.bin; \ test: set -xe; \ @@ -163,6 +164,7 @@ clean: @test -d cmd && find ./cmd -mindepth 2 -maxdepth 2 -type f -name bin -exec rm -f {} \; || true; @test -d cmd && find ./cmd -mindepth 2 -maxdepth 2 -type d -name bins -exec rm -Rf {} \; || true; @find . -name ".tmp-*" -exec rm -Rf {} \; || true; + @find . -maxdepth 1 -name "*.bin" -exec rm -Rf {} \; || true; @find . -mindepth 1 -maxdepth 3 -type f -name $(COVERAGE_FILE) -exec rm -Rf {} \; || true; @find . -mindepth 1 -maxdepth 3 -type f -name tmp$(COVERAGE_FILE) -exec rm -Rf {} \; || true; @@ -199,6 +201,12 @@ else done; false; endif +buildAllBinaries: + set -xe; \ + find ./cmd -mindepth 1 -maxdepth 1 -type d -print | grep -v 'fixture' | grep -v 'scripts' | while read service; do \ + env SERVICE_NAME=$${service##*/} env GOOS=$(GOOS) env GOARCH=$(GOARCH) $(MAKE) dockerfile; \ + done; + # note: it requires make-4.3+ to run that buildMultiPlatformDockerImage: set -xe; \