Skip to content

Commit f6696b2

Browse files
Merge pull request #187 from microsoft/jacob-ronstadt/actions-update-publish
update publish to allow prerelease versions
2 parents b9e1493 + d2ce681 commit f6696b2

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11

2-
name: Build and Publish Windows CodeQL queries
2+
name: Publish CodeQL Pack
33
on:
44
workflow_dispatch:
55
inputs:
6-
version:
6+
codeql-version:
77
description: 'CodeQL version to use'
88
required: true
99
type: string
10+
release-type:
11+
description: 'Publish as a pre-release'
12+
required: false
13+
type: choice
14+
options:
15+
- alpha
16+
- beta
17+
1018
jobs:
1119
publish:
1220
runs-on: windows-latest
@@ -26,7 +34,7 @@ jobs:
2634

2735
- name: CodeQL Download
2836
run:
29-
Invoke-WebRequest -Uri "https://github.com/github/codeql-cli-binaries/releases/download/v${{ github.event.inputs.version }}/codeql-win64.zip" -OutFile codeql-win64.zip;
37+
Invoke-WebRequest -Uri "https://github.com/github/codeql-cli-binaries/releases/download/v${{ github.event.inputs.codeql-version }}/codeql-win64.zip" -OutFile codeql-win64.zip;
3038
Expand-Archive -Path codeql-win64.zip -DestinationPath .\codeql-zip -Force;
3139
Move-Item -Path .\codeql-zip\codeql -Destination .\codeql-cli\
3240

@@ -40,5 +48,12 @@ jobs:
4048
shell: pwsh
4149
env:
4250
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
run:
44-
.\codeql-cli\codeql.cmd pack publish ./src;
51+
run: |
52+
if ("${{ github.event.inputs.release-type }}" -ne "") {
53+
$version =( Select-String .\src\qlpack.yml -Pattern "version").line;
54+
$new_ver = "$version-${{ github.event.inputs.release-type }}";
55+
(Get-Content .\src\qlpack.yml).Replace($version, $new_ver) | Set-Content .\src\qlpack.yml;
56+
.\codeql-cli\codeql.cmd pack publish --allow-prerelease ./src;
57+
} else {
58+
.\codeql-cli\codeql.cmd pack publish ./src
59+
}

0 commit comments

Comments
 (0)