From 725076c438c5ade45b9a2a99eeec8bdefa02ab1d Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Wed, 3 Jun 2026 17:19:18 +0200 Subject: [PATCH 1/3] Workflow proposal for adding artifacts on release --- .github/workflows/release-artifacts.yml | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release-artifacts.yml diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml new file mode 100644 index 00000000..62e8f8e7 --- /dev/null +++ b/.github/workflows/release-artifacts.yml @@ -0,0 +1,58 @@ +name: Release Artifacts + +on: + release: + types: [published] + +jobs: + build: + name: Build ${{ matrix.os }} binary + runs-on: ${{ matrix.runner }} + strategy: + matrix: + include: + - os: linux + runner: ubuntu-latest + target: node20-linux-x64 + artifact: elastic-linux-x64 + - os: macos + runner: macos-latest + target: node20-macos-x64 + artifact: elastic-macos-x64 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build TypeScript + run: npm run build + + - name: Bundle to CJS (required for pkg + ESM) + run: | + npx esbuild dist/cli.js \ + --bundle \ + --platform=node \ + --format=cjs \ + --outfile=dist/cli.cjs + + - name: Package binary with pkg + run: | + npx @yao-pkg/pkg dist/cli.cjs \ + --targets ${{ matrix.target }} \ + --output ${{ matrix.artifact }} + + - name: Upload binary to release + uses: softprops/action-gh-release@v2 + with: + files: ${{ matrix.artifact }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 372e2317ad44c83e50e32063be91e7d134ba33c2 Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Wed, 3 Jun 2026 17:29:12 +0200 Subject: [PATCH 2/3] Fixed issue with new line --- .github/workflows/release-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 62e8f8e7..d662ed37 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -55,4 +55,4 @@ jobs: with: files: ${{ matrix.artifact }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a7cc1593f6b43c984e74bddee2d1b84772632453 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Mon, 15 Jun 2026 12:07:05 -0500 Subject: [PATCH 3/3] Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/release-artifacts.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index d662ed37..504c52a2 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -4,6 +4,9 @@ on: release: types: [published] +permissions: + contents: write + jobs: build: name: Build ${{ matrix.os }} binary