Skip to content

Commit 9a6df03

Browse files
Add a dry run publish script
1 parent 01dfc57 commit 9a6df03

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Publish CodeQL Packs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish_core:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
strategy:
17+
fail-fast: false
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
#- name: Check core qtil (src) pack
23+
# id: check_version
24+
# env:
25+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
# run: |
27+
# PUBLISHED_VERSION=$(gh api /orgs/advanced-security/packages/container/qtil/versions --jq '.[0].metadata.container.tags[0]')
28+
# CURRENT_VERSION=$(grep version src/qlpack.yml | awk '{print $2}')
29+
# echo "Published version: $PUBLISHED_VERSION"
30+
# echo "Local version: $CURRENT_VERSION"
31+
# if [ "$PUBLISHED_VERSION" != "$CURRENT_VERSION" ]; then
32+
# echo "publish=true" >> $GITHUB_OUTPUT
33+
# fi
34+
- name: Setup CodeQL
35+
# if: steps.check_version.outputs.publish == 'true'
36+
uses: ./.github/actions/install-codeql
37+
38+
- name: Publish core qtil (src) pack.
39+
# if: steps.check_version.outputs.publish == 'true'
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
echo "Publishing pack 'qtil'."
44+
codeql pack install "src"
45+
codeql pack publish --dry-run "src"
46+
47+
publish_langs:
48+
runs-on: ubuntu-latest
49+
50+
permissions:
51+
contents: read
52+
packages: write
53+
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
lang: ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "swift"]
58+
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
#- name: Check qtil-LANG (src) pack
63+
# id: check_version
64+
# env:
65+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
# run: |
67+
# PUBLISHED_VERSION=$(gh api /orgs/advanced-security/packages/container/qtil-${{ matrix.language }}/versions --jq '.[0].metadata.container.tags[0]')
68+
# CURRENT_VERSION=$(grep version ${{ matrix.language }}/src/qlpack.yml | awk '{print $2}')
69+
# echo "Published version: $PUBLISHED_VERSION"
70+
# echo "Local version: $CURRENT_VERSION"
71+
# if [ "$PUBLISHED_VERSION" != "$CURRENT_VERSION" ]; then
72+
# echo "publish=true" >> $GITHUB_OUTPUT
73+
# fi
74+
- name: Setup CodeQL
75+
# if: steps.check_version.outputs.publish == 'true'
76+
uses: ./.github/actions/install-codeql
77+
78+
- name: Publish qtil-LANG (src) pack.
79+
# if: steps.check_version.outputs.publish == 'true'
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
run: |
83+
echo "Publishing pack 'qtil-${{ matrix.language }}'."
84+
codeql pack install "${{ matrix.language }}/src"
85+
codeql pack publish --dry-run "${{ matrix.language }}/src"

0 commit comments

Comments
 (0)