From 0fd5b9896e1f4e91093001e243aa66ac7a923e63 Mon Sep 17 00:00:00 2001 From: Kiron Date: Thu, 28 Mar 2024 21:41:52 +0800 Subject: [PATCH] Fix actions workflow --- .github/workflows/main.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 026c04a..33eb33e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -87,13 +87,19 @@ jobs: - name: Output file id: outfile run: | + from os import environ as env from subprocess import check_output - import os - stdout = check_output(["bazel", "cquery", "--config=gnu", "--config=release", "--//:version=0", "--output=files", "//:pkg"], text= True,) + cfg = env.get("CONFIG", "gnu") + v = env.get("VERSION", "0") + stdout = check_output(["bazel", "cquery", f"--config={cfg}", "--config=release", f"--//:version={v}", "--output=files", "//:pkg"], text= True) lines = stdout.split('\n', 1) path = lines[0].strip() - print(f"path={path}", file=open(os.environ.get("GITHUB_OUTPUT", "stdout.txt"), "a")) + print(f"path={path}") + print(f"path={path}", file=open(env.get("GITHUB_OUTPUT", "stdout.txt"), "a")) shell: python3 {0} + env: + CONFIG: ${{ matrix.config }} + VERSION: ${{ github.event.inputs.version || 0 }} - name: Upload package artifact uses: actions/upload-artifact@v4 with: