From c7e7e956eaefeb10fefad23c544f060c15ab1f28 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Mon, 8 Jul 2024 13:28:28 -0700 Subject: [PATCH 01/14] remove version file --- .github/workflows/create-prerelease.yml | 2 +- .gitignore | 3 ++- VERSION.md | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 VERSION.md diff --git a/.github/workflows/create-prerelease.yml b/.github/workflows/create-prerelease.yml index a488b4a..f857c41 100644 --- a/.github/workflows/create-prerelease.yml +++ b/.github/workflows/create-prerelease.yml @@ -14,7 +14,7 @@ on: push: branches: - - "VEC-210-acl" # remove before merge into main + - "actions-hub" # remove before merge into main jobs: build-and-release: runs-on: macos-13 diff --git a/.gitignore b/.gitignore index f7114ee..5498fc5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ features.conf embed_*.go tmp /vendor -/coverage \ No newline at end of file +/coverage +VERSION.md \ No newline at end of file diff --git a/VERSION.md b/VERSION.md deleted file mode 100644 index 6c6aa7c..0000000 --- a/VERSION.md +++ /dev/null @@ -1 +0,0 @@ -0.1.0 \ No newline at end of file From 48050d4c85917e8e6c2a2078e116a59c440dcbfe Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Mon, 8 Jul 2024 16:42:40 -0700 Subject: [PATCH 02/14] fix release --- .github/workflows/create-prerelease.yml | 37 +++++++++++++++++++------ 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/create-prerelease.yml b/.github/workflows/create-prerelease.yml index f857c41..ba461cb 100644 --- a/.github/workflows/create-prerelease.yml +++ b/.github/workflows/create-prerelease.yml @@ -11,10 +11,14 @@ on: description: 'Delete existing pre-releases?' required: false type: boolean + tag: + description: 'If not a dev build, should we tag?' + required: false + type: string - push: - branches: - - "actions-hub" # remove before merge into main + # push: + # branches: + # - "actions-hub" # remove before merge into main jobs: build-and-release: runs-on: macos-13 @@ -45,6 +49,26 @@ jobs: hdiutil attach -mountpoint /Volumes/Packages Packages.dmg cd /Volumes/Packages sudo installer -pkg Install\ Packages.pkg -target / + - name: Tag Before Building + if: inputs.tag != '' + env: + TAG: ${{ inputs.tag }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "Tagging the repository with ${TAG}" + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + # Ensure the tag does not already exist + if ! gh release view "${TAG}" > /dev/null 2>&1; then + git tag -a "${TAG}" -m "Release ${TAG}" + git push origin "${TAG}" + + echo "Tag ${TAG} created and pushed successfully." + else + echo "Tag ${TAG} already exists." + fi + - name: "Compile" env: ADDCOMMIT: ${{ inputs.addCommit }} @@ -111,14 +135,11 @@ jobs: set -e echo "${ADDCOMMIT}" cd ~/work/asvec/asvec/bin/packages - COMMIT=$(git rev-parse --short HEAD) VER=$(cat ../../VERSION.md) RPM_VER=$(echo ${VER} | sed 's/-/_/g') - BRANCH=$(git rev-parse --abbrev-ref HEAD) - TAG=${VER}-${COMMIT} - [ "${ADDCOMMIT}" = "false" ] && TAG=${VER} + TAG=${VER} FULLCOMMIT=$(git rev-parse HEAD) - gh release create -R github.com/aerospike/asvec --notes-file ../../RELEASE.md --prerelease --target ${FULLCOMMIT} --title "Asvec - v${TAG}" ${TAG} asvec-linux-amd64-${VER}.deb asvec-linux-amd64-${RPM_VER}.rpm asvec-linux-amd64-${VER}.zip asvec-linux-arm64-${VER}.deb asvec-linux-arm64-${RPM_VER}.rpm asvec-linux-arm64-${VER}.zip asvec-macos-${VER}.pkg asvec-macos-amd64-${VER}.zip asvec-macos-arm64-${VER}.zip asvec-windows-amd64-${VER}.zip asvec-windows-arm64-${VER}.zip + gh release create -R github.com/aerospike/asvec --notes-file ../../RELEASE.md --prerelease --target ${FULLCOMMIT} --title "Asvec - ${TAG}" ${TAG} asvec-linux-amd64-${VER}.deb asvec-linux-amd64-${RPM_VER}.rpm asvec-linux-amd64-${VER}.zip asvec-linux-arm64-${VER}.deb asvec-linux-arm64-${RPM_VER}.rpm asvec-linux-arm64-${VER}.zip asvec-macos-${VER}.pkg asvec-macos-amd64-${VER}.zip asvec-macos-arm64-${VER}.zip asvec-windows-amd64-${VER}.zip asvec-windows-arm64-${VER}.zip - name: "Delete previous pre-release" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 6d374fe234c9325d613169c04235f31753bf5c44 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Mon, 8 Jul 2024 17:14:15 -0700 Subject: [PATCH 03/14] try new workflow --- .github/workflows/create-prerelease.yml | 31 ++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/create-prerelease.yml b/.github/workflows/create-prerelease.yml index ba461cb..5a2bef6 100644 --- a/.github/workflows/create-prerelease.yml +++ b/.github/workflows/create-prerelease.yml @@ -3,18 +3,19 @@ name: Build and Create Pre-Release on: workflow_dispatch: inputs: - addCommit: - description: 'Dev build?' + version: + description: 'If this is release what version is this for? If this is a pre-release what version are you developing toward?' + required: false + type: string + preRelease: + description: 'Create Pre-release? SNAPSHOT will appended to the version above.' required: false type: boolean deletePrevBuild: description: 'Delete existing pre-releases?' required: false type: boolean - tag: - description: 'If not a dev build, should we tag?' - required: false - type: string + # push: # branches: @@ -50,14 +51,20 @@ jobs: cd /Volumes/Packages sudo installer -pkg Install\ Packages.pkg -target / - name: Tag Before Building - if: inputs.tag != '' + if: inputs.version != '' env: - TAG: ${{ inputs.tag }} + TAG: ${{ inputs.version }} + SNAPSHOT: ${{ inputs.preRelease }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "Tagging the repository with ${TAG}" git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" + + if [ "${SNAPSHOT}" = "true" ]; then + COMMIT=$(git rev-parse --short HEAD) + TAG="${TAG}-SNAPSHOT-${COMMIT}" + fi # Ensure the tag does not already exist if ! gh release view "${TAG}" > /dev/null 2>&1; then @@ -71,7 +78,7 @@ jobs: - name: "Compile" env: - ADDCOMMIT: ${{ inputs.addCommit }} + ADDCOMMIT: ${{ inputs.preRelease }} run: | buildcmd="build-prerelease" [ "${ADDCOMMIT}" = "false" ] && buildcmd="build-official" @@ -79,7 +86,7 @@ jobs: cd ~/work/asvec/asvec && make cleanall && make ${buildcmd} - name: "Create linux packages" env: - ADDCOMMIT: ${{ inputs.addCommit }} + ADDCOMMIT: ${{ inputs.preRelease }} run: | buildcmd="build-prerelease" [ "${ADDCOMMIT}" = "false" ] && buildcmd="build-official" @@ -87,7 +94,7 @@ jobs: cd ~/work/asvec/asvec && make pkg-linux - name: "Create windows zips" env: - ADDCOMMIT: ${{ inputs.addCommit }} + ADDCOMMIT: ${{ inputs.preRelease }} run: | buildcmd="build-prerelease" [ "${ADDCOMMIT}" = "false" ] && buildcmd="build-official" @@ -130,10 +137,8 @@ jobs: - name: "Create a new pre-release" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ADDCOMMIT: ${{ inputs.addCommit }} run: | set -e - echo "${ADDCOMMIT}" cd ~/work/asvec/asvec/bin/packages VER=$(cat ../../VERSION.md) RPM_VER=$(echo ${VER} | sed 's/-/_/g') From 1ddebf04e051b5f7f452e18281e20fadf2772663 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Mon, 8 Jul 2024 17:23:37 -0700 Subject: [PATCH 04/14] test out build workflow From 450b59a330d59f8e8f10fc66801a5a5bf59fc459 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Mon, 8 Jul 2024 17:35:33 -0700 Subject: [PATCH 05/14] test out build workflow From 2fd6bb967200d9e9e5a782abd2044b6fa6b2d36d Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Tue, 9 Jul 2024 09:13:25 -0700 Subject: [PATCH 06/14] fix build --- .github/workflows/create-prerelease.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-prerelease.yml b/.github/workflows/create-prerelease.yml index 5a2bef6..09d1cbc 100644 --- a/.github/workflows/create-prerelease.yml +++ b/.github/workflows/create-prerelease.yml @@ -8,11 +8,11 @@ on: required: false type: string preRelease: - description: 'Create Pre-release? SNAPSHOT will appended to the version above.' + description: 'Create Pre-release? -SNAPSHOT-{COMMIT} will appended to the version above.' required: false type: boolean deletePrevBuild: - description: 'Delete existing pre-releases?' + description: 'Cleanup existing pre-releases?' required: false type: boolean @@ -147,6 +147,7 @@ jobs: gh release create -R github.com/aerospike/asvec --notes-file ../../RELEASE.md --prerelease --target ${FULLCOMMIT} --title "Asvec - ${TAG}" ${TAG} asvec-linux-amd64-${VER}.deb asvec-linux-amd64-${RPM_VER}.rpm asvec-linux-amd64-${VER}.zip asvec-linux-arm64-${VER}.deb asvec-linux-arm64-${RPM_VER}.rpm asvec-linux-arm64-${VER}.zip asvec-macos-${VER}.pkg asvec-macos-amd64-${VER}.zip asvec-macos-arm64-${VER}.zip asvec-windows-amd64-${VER}.zip asvec-windows-arm64-${VER}.zip - name: "Delete previous pre-release" env: + TAG: ${{ inputs.version }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} DELPREV: ${{ inputs.deletePrevBuild }} run: | @@ -157,7 +158,7 @@ jobs: do if [ "$line" != "${TAG}" ] then - if [[ $line =~ ^${VER}- ]] + if [[ $line =~ ^${TAG}- ]] then echo "Removing $line" gh release delete $line -R github.com/aerospike/asvec --yes --cleanup-tag From baef480ce55ed751764cea4fce9ff5def2b3ad8c Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Tue, 9 Jul 2024 09:46:51 -0700 Subject: [PATCH 07/14] build: VEC-228 create release and pre-release workflows From 38e57ec6a8427e350b7099a8c6bdd622cef763f1 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Tue, 9 Jul 2024 09:52:33 -0700 Subject: [PATCH 08/14] typos --- .github/workflows/create-prerelease.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-prerelease.yml b/.github/workflows/create-prerelease.yml index 09d1cbc..858a653 100644 --- a/.github/workflows/create-prerelease.yml +++ b/.github/workflows/create-prerelease.yml @@ -4,11 +4,11 @@ on: workflow_dispatch: inputs: version: - description: 'If this is release what version is this for? If this is a pre-release what version are you developing toward?' + description: 'If this is a release what version is this for? If this is a pre-release what version are you developing toward?' required: false type: string preRelease: - description: 'Create Pre-release? -SNAPSHOT-{COMMIT} will appended to the version above.' + description: 'Create Pre-release? -SNAPSHOT-{COMMIT} will be appended to the version above.' required: false type: boolean deletePrevBuild: From a6f79ff05bd8e7eece0e711e77442213eedc6712 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Tue, 9 Jul 2024 09:57:39 -0700 Subject: [PATCH 09/14] try increasing runner size --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32df685..fb19d1c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ on: jobs: tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04-4core steps: - uses: actions/checkout@v3 - name: Get go version from go.mod From df673b826a94a6e6ae44fd35f43174e76a9856cd Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Tue, 9 Jul 2024 12:03:12 -0700 Subject: [PATCH 10/14] make version required --- .github/workflows/create-prerelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-prerelease.yml b/.github/workflows/create-prerelease.yml index 858a653..1b571c7 100644 --- a/.github/workflows/create-prerelease.yml +++ b/.github/workflows/create-prerelease.yml @@ -5,7 +5,7 @@ on: inputs: version: description: 'If this is a release what version is this for? If this is a pre-release what version are you developing toward?' - required: false + required: true type: string preRelease: description: 'Create Pre-release? -SNAPSHOT-{COMMIT} will be appended to the version above.' From 1fc762f4bc78be443e8228f0bf490ea6b04441d9 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Wed, 10 Jul 2024 11:11:23 -0700 Subject: [PATCH 11/14] ci: Use aerospike_large_runners_8 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb19d1c..8cd4b0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ on: jobs: tests: - runs-on: ubuntu-22.04-4core + runs-on: aerospike_large_runners_8 steps: - uses: actions/checkout@v3 - name: Get go version from go.mod From f79532850e1bbe60ed48abce9cd88156258f46ef Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Wed, 10 Jul 2024 11:30:13 -0700 Subject: [PATCH 12/14] add debug flag --- e2e_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e_test.go b/e2e_test.go index 67acc3f..c38089f 100644 --- a/e2e_test.go +++ b/e2e_test.go @@ -1031,7 +1031,7 @@ func docker_compose_up(composeFile string) error { ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() - cmd := exec.CommandContext(ctx, "docker", "compose", fmt.Sprintf("-f%s", composeFile), "up", "-d") + cmd := exec.CommandContext(ctx, "docker", "-lDEBUG", "compose", fmt.Sprintf("-f%s", composeFile), "up", "-d") output, err := cmd.CombinedOutput() fmt.Printf("docker compose up output: %s\n", string(output)) From 074d8b4bf8b9d0a276a94ad41ac05dc49003ae66 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Wed, 10 Jul 2024 11:44:25 -0700 Subject: [PATCH 13/14] add cleanup --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8cd4b0c..4f00621 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,10 @@ jobs: - name: Login to Aerospike Jfrog run: | docker login aerospike.jfrog.io --username ${{ secrets.JFROG_USERNAME }} --password ${{ secrets.JFROG_ACCESS_TOKEN }} + - name: Clear Docker Cache + run: | + docker system prune --all --force + - name: Run tests run: | make coverage From 26844d1d6dff43a5663ddefb4213593406dd7441 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Wed, 10 Jul 2024 11:47:30 -0700 Subject: [PATCH 14/14] remove prune --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4f00621..fb638ad 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,9 +28,9 @@ jobs: - name: Login to Aerospike Jfrog run: | docker login aerospike.jfrog.io --username ${{ secrets.JFROG_USERNAME }} --password ${{ secrets.JFROG_ACCESS_TOKEN }} - - name: Clear Docker Cache - run: | - docker system prune --all --force + # - name: Clear Docker Cache + # run: | + # docker system prune --all --force - name: Run tests run: |