Skip to content

Commit d91d2d2

Browse files
committed
Upload the runner to the release directly
1 parent ffaa8aa commit d91d2d2

1 file changed

Lines changed: 33 additions & 19 deletions

File tree

.github/workflows/build-runner.yml

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,45 @@ on:
44
push:
55
workflow_dispatch:
66
inputs:
7+
bundle-tag:
8+
description: 'Tag of the bundle release (e.g., "codeql-bundle-20200826")'
9+
required: true
710

811
jobs:
912
build-runner:
1013
runs-on: ubuntu-latest
14+
env:
15+
RELEASE_TAG: test-build-runner # "${{ github.event.inputs.bundle-tag }}"
1116

12-
steps:
13-
- uses: actions/checkout@v2
17+
strategy:
18+
matrix:
19+
extension: ["linux", "macos", "win.exe"]
1420

15-
- name: Build runner
16-
run: |
17-
cd runner
18-
npm install
19-
npm run build-runner
21+
steps:
22+
- uses: actions/checkout@v2
2023

21-
- uses: actions/upload-artifact@v2
22-
with:
23-
name: codeql-runner-linux
24-
path: runner/dist/codeql-runner-linux
24+
- name: Resolve Upload URL for the release
25+
id: save_url
26+
run: |
27+
UPLOAD_URL=$(curl -sS \
28+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${RELEASE_TAG}" \
29+
-H "Accept: application/json" \
30+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" | jq .upload_url | sed s/\"//g)
31+
echo ${UPLOAD_URL}
32+
echo "::set-output name=upload_url::${UPLOAD_URL}"
2533
26-
- uses: actions/upload-artifact@v2
27-
with:
28-
name: codeql-runner-macos
29-
path: runner/dist/codeql-runner-macos
34+
- name: Build runner
35+
run: |
36+
cd runner
37+
npm install
38+
npm run build-runner
3039
31-
- uses: actions/upload-artifact@v2
32-
with:
33-
name: codeql-runner-win.exe
34-
path: runner/dist/codeql-runner-win.exe
40+
- name: Upload Platform Package
41+
uses: actions/upload-release-asset@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
upload_url: ${{ steps.save_url.outputs.upload_url }}
46+
asset_path: runner/dist/codeql-runner-${{matrix.extension}}
47+
asset_name: codeql-runner-${{matrix.extension}}
48+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)