From 5b3b1aaea5fafdf8a96a2603fb71562cbfe7409f Mon Sep 17 00:00:00 2001 From: Toliver Jue Date: Tue, 29 Jul 2025 15:00:45 +0900 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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]