Skip to content

Commit 6ac5978

Browse files
authored
Merge pull request #266 from github/robertbrignull/runner_workflow
Add a workflow to build and upload the runner
2 parents c8b8c04 + 59913e8 commit 6ac5978

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release runner
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bundle-tag:
7+
description: 'Tag of the bundle release (e.g., "codeql-bundle-20200826")'
8+
required: false
9+
10+
jobs:
11+
release-runner:
12+
runs-on: ubuntu-latest
13+
env:
14+
RELEASE_TAG: "${{ github.event.inputs.bundle-tag }}"
15+
16+
strategy:
17+
matrix:
18+
extension: ["linux", "macos", "win.exe"]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Build runner
24+
run: |
25+
cd runner
26+
npm install
27+
npm run build-runner
28+
29+
- uses: actions/upload-artifact@v2
30+
with:
31+
name: codeql-runner-${{matrix.extension}}
32+
path: runner/dist/codeql-runner-${{matrix.extension}}
33+
34+
- name: Resolve Upload URL for the release
35+
if: ${{ github.event.inputs.bundle-tag != null }}
36+
id: save_url
37+
run: |
38+
UPLOAD_URL=$(curl -sS \
39+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${RELEASE_TAG}" \
40+
-H "Accept: application/json" \
41+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" | jq .upload_url | sed s/\"//g)
42+
echo ${UPLOAD_URL}
43+
echo "::set-output name=upload_url::${UPLOAD_URL}"
44+
45+
- name: Upload Platform Package
46+
if: ${{ github.event.inputs.bundle-tag != null }}
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ steps.save_url.outputs.upload_url }}
52+
asset_path: runner/dist/codeql-runner-${{matrix.extension}}
53+
asset_name: codeql-runner-${{matrix.extension}}
54+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)