From 956f58865f89496a0900e008e208e67e61d304e0 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Thu, 5 Feb 2026 13:19:54 -0500 Subject: [PATCH] chore: add upload of release artifacts to GitHub releases --- .github/workflows/main.yaml | 31 +++++++++++++++++++ .../workflows_template.libsonnet | 26 ++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f05c7726..7440c523 100755 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -648,6 +648,37 @@ "run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..." } ] + }, + "publish": { + "name": "publish", + "needs": [ + "build_and_test" + ], + "runs-on": "ubuntu-latest", + "steps": [ + { + "name": "Download release artifacts", + "uses": "actions/download-artifact@v4", + "with": { + "merge-multiple": true + } + }, + { + "name": "Calculate shasum", + "run": "shasum -a 256 assets/* > sha256" + }, + { + "name": "Create GitHub release and upload artifacts", + "uses": "softprops/action-gh-release@v2", + "with": { + "files": [ + "assets/*", + "sha256" + ], + "make_latest": true + } + } + ] } }, "name": "main", diff --git a/tools/github_workflows/workflows_template.libsonnet b/tools/github_workflows/workflows_template.libsonnet index 1b8c7362..4e2503da 100644 --- a/tools/github_workflows/workflows_template.libsonnet +++ b/tools/github_workflows/workflows_template.libsonnet @@ -148,6 +148,32 @@ else [] ), }, + [if doUpload then 'publish']: { + 'runs-on': 'ubuntu-latest', + name: 'publish', + needs: ['build_and_test'], + steps: [ + { + name: 'Download release artifacts', + uses: 'actions/download-artifact@v4', + with: { + 'merge-multiple': true, + }, + }, + { + name: 'Calculate shasum', + run: 'shasum -a 256 assets/* > sha256', + }, + { + name: 'Create GitHub release and upload artifacts', + uses: 'softprops/action-gh-release@v2', + with: { + make_latest: true, + files: ['assets/*', 'sha256'], + }, + }, + ], + }, lint: { 'runs-on': 'ubuntu-latest', name: 'lint',