From 5b3b1aaea5fafdf8a96a2603fb71562cbfe7409f Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Tue, 29 Jul 2025 15:00:45 +0900 Subject: [PATCH 01/30] test release --- .github/workflows/main.yml | 42 +++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2653288..51b2ae6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,10 +15,26 @@ name: Bazel on: - pull_request: {} + pull_request: + branches: [main] + push: {} release: types: [published] + workflow_dispatch: + inputs: + create_release: + description: "Create GitHub release" + type: boolean + default: false + version: + description: "Release version" + required: false + type: string + upload_to_registry: + description: "Upload to package registry" + type: boolean + default: false jobs: build-and-test: @@ -101,3 +117,27 @@ jobs: name: api.html path: | bazel-bin/api/api.html/api.html + + create-release: + needs: [build-and-upload-tools] + runs-on: ubuntu-latest + if: | + github.event_name == 'workflow_dispatch' && + inputs.create_release == true + + steps: + - uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ inputs.version }} + name: Release ${{ inputs.version }} + draft: true + files: | + nbictl-* + agent-* + generate_release_notes: true From 9b6d34cf88462288660e1090c2418eee53a6e828 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Tue, 29 Jul 2025 15:17:51 +0900 Subject: [PATCH 02/30] fixme --- .github/workflows/main.yml | 51 +++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51b2ae6..54886a8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,8 @@ jobs: - run: bazelisk test //... build-and-upload-tools: - needs: [build-and-test] + # FIXME + # needs: [build-and-test] strategy: matrix: # Only the go_binary targets support cross-compilation at the moment: @@ -97,26 +98,27 @@ jobs: with: name: agent-${{ matrix.os }}-${{ matrix.arch }} path: bazel-bin/agent/cmd/agent/agent_/agent.exe - - build-and-upload-docs: - needs: [build-and-test] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/bazelisk - ~/.cache/bazel - key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} - restore-keys: bazel- - - run: bazelisk build "//api:api.html" - - name: Upload API docs - uses: actions/upload-artifact@v4 - with: - name: api.html - path: | - bazel-bin/api/api.html/api.html + + # FIXME + # build-and-upload-docs: + # needs: [build-and-test] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/cache@v4 + # with: + # path: | + # ~/.cache/bazelisk + # ~/.cache/bazel + # key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} + # restore-keys: bazel- + # - run: bazelisk build "//api:api.html" + # - name: Upload API docs + # uses: actions/upload-artifact@v4 + # with: + # name: api.html + # path: | + # bazel-bin/api/api.html/api.html create-release: needs: [build-and-upload-tools] @@ -134,8 +136,11 @@ jobs: - name: Create Release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ inputs.version }} - name: Release ${{ inputs.version }} + # FIXME + # tag_name: ${{ inputs.version }} + # name: FIXME Release ${{ inputs.version }} + tag_name: FIXME-test-release-${{ github.ref_name }} + name: FIXME Release ${{ github.ref_name }} draft: true files: | nbictl-* From 163c6826909d9bffd3766cfadfc06f4ddfd79f46 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Tue, 29 Jul 2025 15:22:40 +0900 Subject: [PATCH 03/30] fixme --- .github/workflows/main.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54886a8..4f5ad79 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,18 +37,19 @@ on: default: false jobs: - build-and-test: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/bazelisk - ~/.cache/bazel - key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} - restore-keys: bazel- - - run: bazelisk test //... + # FIXME + # build-and-test: + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/cache@v4 + # with: + # path: | + # ~/.cache/bazelisk + # ~/.cache/bazel + # key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} + # restore-keys: bazel- + # - run: bazelisk test //... build-and-upload-tools: # FIXME @@ -59,7 +60,9 @@ jobs: target: - //agent/cmd/agent - //tools/nbictl/cmd/nbictl - os: [linux, windows, darwin] + # FIXME + # os: [linux, windows, darwin] + os: [linux, darwin] arch: [amd64, arm64] runs-on: ubuntu-latest From 76c3ebc19603204da029944ec0994d4c6874f586 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Tue, 29 Jul 2025 15:26:23 +0900 Subject: [PATCH 04/30] fixme --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f5ad79..e163149 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -126,9 +126,10 @@ jobs: create-release: needs: [build-and-upload-tools] runs-on: ubuntu-latest - if: | - github.event_name == 'workflow_dispatch' && - inputs.create_release == true + # FIXME + # if: | + # github.event_name == 'workflow_dispatch' && + # inputs.create_release == true steps: - uses: actions/checkout@v4 From 029d87069606b8a319f4bea36b48b0cb21cd5231 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Tue, 29 Jul 2025 15:29:51 +0900 Subject: [PATCH 05/30] env --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e163149..e8a35ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -150,3 +150,5 @@ jobs: nbictl-* agent-* generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 583fb7ca3237d54c78566163458b6fa6994012e3 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 01:15:01 +0900 Subject: [PATCH 06/30] token --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e8a35ff..f4677b5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -151,4 +151,4 @@ jobs: agent-* generate_release_notes: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} \ No newline at end of file From bd8847c7d2464fc210916adc89c5980857c640c0 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 01:26:43 +0900 Subject: [PATCH 07/30] perm --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4677b5..2857af3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,10 @@ name: Bazel +# Needed for creating releases +permissions: + contents: write + on: pull_request: branches: [main] From 2c1980c0d52728528390f0e3f5ccd90bebe8dba7 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 13:47:07 +0900 Subject: [PATCH 08/30] less arch --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2857af3..89bd28b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,8 +66,9 @@ jobs: - //tools/nbictl/cmd/nbictl # FIXME # os: [linux, windows, darwin] - os: [linux, darwin] - arch: [amd64, arm64] + # arch: [amd64, arm64] + os: [linux] + arch: [amd64] runs-on: ubuntu-latest steps: From 257710859b9052307ea27146b1fa2bd69cf85c41 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 13:55:34 +0900 Subject: [PATCH 09/30] show --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89bd28b..2f98daf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -142,6 +142,10 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 + # FIXME + - name: Show artifact structure + run: | + find . -name "nbictl" | head -10 - name: Create Release uses: softprops/action-gh-release@v2 with: From fbe804d2d5c2445eecba7e839ae2a10ce57c728e Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 14:02:57 +0900 Subject: [PATCH 10/30] ls --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f98daf..3022f31 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -145,7 +145,7 @@ jobs: # FIXME - name: Show artifact structure run: | - find . -name "nbictl" | head -10 + ls -alR - name: Create Release uses: softprops/action-gh-release@v2 with: From 662a7fc1892f449a862b561a72e4c2311c56a316 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 14:16:10 +0900 Subject: [PATCH 11/30] dir --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3022f31..095c05f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -156,8 +156,8 @@ jobs: name: FIXME Release ${{ github.ref_name }} draft: true files: | - nbictl-* - agent-* + nbictl-*/ + agent-*/ generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} \ No newline at end of file From 10ab4fe6fe50d9bdf16041e45ec377535b7b4735 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 14:19:57 +0900 Subject: [PATCH 12/30] nbi --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 095c05f..1f6d6fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -156,8 +156,7 @@ jobs: name: FIXME Release ${{ github.ref_name }} draft: true files: | - nbictl-*/ - agent-*/ + nbictl-linux-amd64/ generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} \ No newline at end of file From ffd92e3b2f8bacab4f9a02bf8c846b4810e72121 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 14:25:09 +0900 Subject: [PATCH 13/30] more --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f6d6fc..561ca95 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -156,7 +156,7 @@ jobs: name: FIXME Release ${{ github.ref_name }} draft: true files: | - nbictl-linux-amd64/ + nbictl-linux-amd64/nbictl generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} \ No newline at end of file From dc10bbc4074809260fd44b88104dfc62a34d5a3e Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 14:59:37 +0900 Subject: [PATCH 14/30] zip --- .github/workflows/main.yml | 44 +++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 561ca95..8edea77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,30 +82,39 @@ jobs: restore-keys: bazel- - run: bazel/tools/update_version_bzl.sh version.bzl - run: bazelisk build --stamp "--platforms=@rules_go//go/toolchain:${{ matrix.os }}_${{ matrix.arch }}" "${{ matrix.target }}" - - name: Upload nbictl binary - uses: actions/upload-artifact@v4 + + - name: Package nbictl binary if: ${{ matrix.target == '//tools/nbictl/cmd/nbictl' && matrix.os != 'windows' }} - with: - name: nbictl-${{ matrix.os }}-${{ matrix.arch }} - path: bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl - - name: Upload nbictl binary - Windows - uses: actions/upload-artifact@v4 + run: | + zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl + + - name: Package nbictl binary - Windows if: ${{ matrix.target == '//tools/nbictl/cmd/nbictl' && matrix.os == 'windows' }} + run: | + zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl.exe + + - name: Package agent binary + if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os != 'windows' }} + run: | + zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent + + - name: Package agent binary - Windows + if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os != 'windows' }} + run: | + zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent.exe + + - name: Upload nbictl binary + uses: actions/upload-artifact@v4 + if: ${{ matrix.target == '//tools/nbictl/cmd/nbictl' }} with: name: nbictl-${{ matrix.os }}-${{ matrix.arch }} - path: bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl.exe + path: nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip - name: Upload agent binary uses: actions/upload-artifact@v4 if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os != 'windows' }} with: name: agent-${{ matrix.os }}-${{ matrix.arch }} - path: bazel-bin/agent/cmd/agent/agent_/agent - - name: Upload agent binary - Windows - uses: actions/upload-artifact@v4 - if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os == 'windows' }} - with: - name: agent-${{ matrix.os }}-${{ matrix.arch }} - path: bazel-bin/agent/cmd/agent/agent_/agent.exe + path: agent-${{ matrix.os }}-${{ matrix.arch }}.zip # FIXME # build-and-upload-docs: @@ -156,7 +165,8 @@ jobs: name: FIXME Release ${{ github.ref_name }} draft: true files: | - nbictl-linux-amd64/nbictl + nbictl-*.zip + agent-*.zip generate_release_notes: true env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} From cbacceb24170cccbbc8ad41623ddc20553dd7671 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:01:36 +0900 Subject: [PATCH 15/30] fix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8edea77..37980b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,7 +99,7 @@ jobs: zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent - name: Package agent binary - Windows - if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os != 'windows' }} + if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os == 'windows' }} run: | zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent.exe From f65fdb41bbd9328df61a0883501fd91d6d9dc8a2 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:04:14 +0900 Subject: [PATCH 16/30] wild --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 37980b4..9e949d8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -165,8 +165,8 @@ jobs: name: FIXME Release ${{ github.ref_name }} draft: true files: | - nbictl-*.zip - agent-*.zip + nbictl-*/*.zip + agent-*/*.zip generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} From cf873e66293913bd1918abdc9b9c55a4784494ab Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:07:48 +0900 Subject: [PATCH 17/30] arch --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e949d8..eaf84b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,10 +65,10 @@ jobs: - //agent/cmd/agent - //tools/nbictl/cmd/nbictl # FIXME - # os: [linux, windows, darwin] - # arch: [amd64, arm64] - os: [linux] - arch: [amd64] + os: [linux, windows, darwin] + arch: [amd64, arm64] + # os: [linux] + # arch: [amd64] runs-on: ubuntu-latest steps: From 3704796b43dd6779b356fbc2a982dc4c6b2dc31c Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:11:48 +0900 Subject: [PATCH 18/30] 2 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eaf84b8..6a4e2d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -162,7 +162,7 @@ jobs: # tag_name: ${{ inputs.version }} # name: FIXME Release ${{ inputs.version }} tag_name: FIXME-test-release-${{ github.ref_name }} - name: FIXME Release ${{ github.ref_name }} + name: FIXME Release ${{ github.ref_name }} 2 draft: true files: | nbictl-*/*.zip From 206cf16d79b09382bafdbe6c1df2289190892fd9 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:16:49 +0900 Subject: [PATCH 19/30] targets --- .github/workflows/main.yml | 42 ++++++++++++-------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a4e2d1..12d63a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,9 +61,9 @@ jobs: strategy: matrix: # Only the go_binary targets support cross-compilation at the moment: - target: - - //agent/cmd/agent - - //tools/nbictl/cmd/nbictl + # target: + # - //agent/cmd/agent + # - //tools/nbictl/cmd/nbictl # FIXME os: [linux, windows, darwin] arch: [amd64, arm64] @@ -81,40 +81,25 @@ jobs: key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} restore-keys: bazel- - run: bazel/tools/update_version_bzl.sh version.bzl - - run: bazelisk build --stamp "--platforms=@rules_go//go/toolchain:${{ matrix.os }}_${{ matrix.arch }}" "${{ matrix.target }}" + - run: bazelisk build --stamp "--platforms=@rules_go//go/toolchain:${{ matrix.os }}_${{ matrix.arch }}" //agent/cmd/agent //tools/nbictl/cmd/nbictl - - name: Package nbictl binary - if: ${{ matrix.target == '//tools/nbictl/cmd/nbictl' && matrix.os != 'windows' }} + - name: Package binary + if: ${{ matrix.os != 'windows' }} run: | zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl - - - name: Package nbictl binary - Windows - if: ${{ matrix.target == '//tools/nbictl/cmd/nbictl' && matrix.os == 'windows' }} - run: | - zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl.exe - - - name: Package agent binary - if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os != 'windows' }} - run: | zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent - - name: Package agent binary - Windows - if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os == 'windows' }} + - name: Package binary - Windows + if: ${{ matrix.os == 'windows' }} run: | + zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl.exe zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent.exe - - name: Upload nbictl binary - uses: actions/upload-artifact@v4 - if: ${{ matrix.target == '//tools/nbictl/cmd/nbictl' }} - with: - name: nbictl-${{ matrix.os }}-${{ matrix.arch }} - path: nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip - - name: Upload agent binary + - name: Upload binary uses: actions/upload-artifact@v4 - if: ${{ matrix.target == '//agent/cmd/agent' && matrix.os != 'windows' }} with: - name: agent-${{ matrix.os }}-${{ matrix.arch }} - path: agent-${{ matrix.os }}-${{ matrix.arch }}.zip + name: tools-${{ matrix.os }}-${{ matrix.arch }} + path: *.zip # FIXME # build-and-upload-docs: @@ -165,8 +150,7 @@ jobs: name: FIXME Release ${{ github.ref_name }} 2 draft: true files: | - nbictl-*/*.zip - agent-*/*.zip + tools-*/*.zip generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} From 456f14163074aa69735a45a38bb92a81399624b8 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:19:04 +0900 Subject: [PATCH 20/30] targets 2 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12d63a4..8fac348 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,7 +99,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: tools-${{ matrix.os }}-${{ matrix.arch }} - path: *.zip + path: '*.zip' # FIXME # build-and-upload-docs: From fdb94a30ba518db0a4b1fd167f6e5d63b7452d27 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:27:37 +0900 Subject: [PATCH 21/30] reg --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8fac348..b92367c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,10 +35,6 @@ on: description: "Release version" required: false type: string - upload_to_registry: - description: "Upload to package registry" - type: boolean - default: false jobs: # FIXME From d8cf617338301a68326a416b7286897bb001d01b Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:29:40 +0900 Subject: [PATCH 22/30] fixme --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b92367c..8faacc6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,10 +61,10 @@ jobs: # - //agent/cmd/agent # - //tools/nbictl/cmd/nbictl # FIXME - os: [linux, windows, darwin] - arch: [amd64, arm64] - # os: [linux] - # arch: [amd64] + # os: [linux, windows, darwin] + # arch: [amd64, arm64] + os: [linux] + arch: [amd64] runs-on: ubuntu-latest steps: From 0c77b9b1f624c66a34ecdb11e70d5c24b8d9987f Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:29:53 +0900 Subject: [PATCH 23/30] perm --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8faacc6..bdf6b1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,8 @@ name: Bazel # Needed for creating releases -permissions: - contents: write +# permissions: +# contents: write on: pull_request: From f4dcda2aad328872dcfc0aaf161b5e49b12e09f1 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:32:13 +0900 Subject: [PATCH 24/30] token --- .github/workflows/main.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bdf6b1a..f9fe085 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,6 @@ name: Bazel -# Needed for creating releases -# permissions: -# contents: write - on: pull_request: branches: [main] @@ -148,5 +144,5 @@ jobs: files: | tools-*/*.zip generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + # env: + # GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} From 0144b0dd9f8b1ac5dfbc4f7792bbd8666c45c818 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:38:30 +0900 Subject: [PATCH 25/30] tools --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9fe085..aa653b9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -127,6 +127,8 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 + with: + pattern: tools-* # FIXME - name: Show artifact structure @@ -144,5 +146,3 @@ jobs: files: | tools-*/*.zip generate_release_notes: true - # env: - # GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} From 7ac6b8c120eb7f8fc2103223430f14497a90362b Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:44:28 +0900 Subject: [PATCH 26/30] name --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa653b9..d764158 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -139,9 +139,8 @@ jobs: with: # FIXME # tag_name: ${{ inputs.version }} - # name: FIXME Release ${{ inputs.version }} + name: FIXME Release ${{ github.ref_name }} ${{ inputs.version }} tag_name: FIXME-test-release-${{ github.ref_name }} - name: FIXME Release ${{ github.ref_name }} 2 draft: true files: | tools-*/*.zip From c9e91f191a7bf20f6358769d6ab104dc2c1148ae Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:47:39 +0900 Subject: [PATCH 27/30] version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d764158..ea32758 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -140,7 +140,7 @@ jobs: # FIXME # tag_name: ${{ inputs.version }} name: FIXME Release ${{ github.ref_name }} ${{ inputs.version }} - tag_name: FIXME-test-release-${{ github.ref_name }} + tag_name: FIXME-test-release-${{ github.ref_name }}-${{ inputs.version }} draft: true files: | tools-*/*.zip From b9f264ab180f70c0c79029f00253f55330fb3409 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 15:51:55 +0900 Subject: [PATCH 28/30] fmt --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ea32758..63e467e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,21 +78,21 @@ jobs: - name: Package binary if: ${{ matrix.os != 'windows' }} run: | - zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl - zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent + zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl + zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent - name: Package binary - Windows if: ${{ matrix.os == 'windows' }} run: | - zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl.exe - zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent.exe + zip -j nbictl-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/tools/nbictl/cmd/nbictl/nbictl_/nbictl.exe + zip -j agent-${{ matrix.os }}-${{ matrix.arch }}.zip bazel-bin/agent/cmd/agent/agent_/agent.exe - name: Upload binary uses: actions/upload-artifact@v4 with: name: tools-${{ matrix.os }}-${{ matrix.arch }} - path: '*.zip' - + path: "*.zip" + # FIXME # build-and-upload-docs: # needs: [build-and-test] From e0b143411d978703608bca7a662a4b934aa8acd1 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Wed, 30 Jul 2025 16:17:40 +0900 Subject: [PATCH 29/30] cleanup --- .github/workflows/main.yml | 98 ++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 58 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63e467e..1b45ebc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,9 +15,7 @@ name: Bazel on: - pull_request: - branches: [main] - + pull_request: {} push: {} release: types: [published] @@ -33,34 +31,25 @@ on: type: string jobs: - # FIXME - # build-and-test: - # runs-on: ubuntu-22.04 - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/cache@v4 - # with: - # path: | - # ~/.cache/bazelisk - # ~/.cache/bazel - # key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} - # restore-keys: bazel- - # - run: bazelisk test //... + build-and-test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cache/bazelisk + ~/.cache/bazel + key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} + restore-keys: bazel- + - run: bazelisk test //... build-and-upload-tools: - # FIXME - # needs: [build-and-test] + needs: [build-and-test] strategy: matrix: - # Only the go_binary targets support cross-compilation at the moment: - # target: - # - //agent/cmd/agent - # - //tools/nbictl/cmd/nbictl - # FIXME - # os: [linux, windows, darwin] - # arch: [amd64, arm64] - os: [linux] - arch: [amd64] + os: [linux, windows, darwin] + arch: [amd64, arm64] runs-on: ubuntu-latest steps: @@ -93,34 +82,32 @@ jobs: name: tools-${{ matrix.os }}-${{ matrix.arch }} path: "*.zip" - # FIXME - # build-and-upload-docs: - # needs: [build-and-test] - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/cache@v4 - # with: - # path: | - # ~/.cache/bazelisk - # ~/.cache/bazel - # key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} - # restore-keys: bazel- - # - run: bazelisk build "//api:api.html" - # - name: Upload API docs - # uses: actions/upload-artifact@v4 - # with: - # name: api.html - # path: | - # bazel-bin/api/api.html/api.html + build-and-upload-docs: + needs: [build-and-test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cache/bazelisk + ~/.cache/bazel + key: bazel-${{ hashFiles('common.bazelrc', '.bazelrc', '.bazelversion', 'WORKSPACE', 'MODULE.bazel', 'requirements.txt') }} + restore-keys: bazel- + - run: bazelisk build "//api:api.html" + - name: Upload API docs + uses: actions/upload-artifact@v4 + with: + name: api.html + path: | + bazel-bin/api/api.html/api.html create-release: needs: [build-and-upload-tools] runs-on: ubuntu-latest - # FIXME - # if: | - # github.event_name == 'workflow_dispatch' && - # inputs.create_release == true + if: | + github.event_name == 'workflow_dispatch' && + inputs.create_release == true steps: - uses: actions/checkout@v4 @@ -130,17 +117,12 @@ jobs: with: pattern: tools-* - # FIXME - - name: Show artifact structure - run: | - ls -alR - name: Create Release uses: softprops/action-gh-release@v2 with: + tag_name: ${{ inputs.version }} + name: Release ${{ inputs.version }} # FIXME - # tag_name: ${{ inputs.version }} - name: FIXME Release ${{ github.ref_name }} ${{ inputs.version }} - tag_name: FIXME-test-release-${{ github.ref_name }}-${{ inputs.version }} draft: true files: | tools-*/*.zip From 8e6e379492c61b0e6d58f45c868258ec4aeeefc9 Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Thu, 31 Jul 2025 01:04:51 +0900 Subject: [PATCH 30/30] todo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1b45ebc..fd19f2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -122,7 +122,7 @@ jobs: with: tag_name: ${{ inputs.version }} name: Release ${{ inputs.version }} - # FIXME + # TODO: Change to non-draft after testing. draft: true files: | tools-*/*.zip