From 9a6df03978eaa1290d5eac321ab2123dd55f738a Mon Sep 17 00:00:00 2001 From: Mike Fairhurst Date: Mon, 21 Jul 2025 11:39:19 -0700 Subject: [PATCH 1/3] Add a dry run publish script --- .github/actions/publish/publish.yml | 85 +++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/actions/publish/publish.yml diff --git a/.github/actions/publish/publish.yml b/.github/actions/publish/publish.yml new file mode 100644 index 0000000..b8625c7 --- /dev/null +++ b/.github/actions/publish/publish.yml @@ -0,0 +1,85 @@ +name: Publish CodeQL Packs + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + publish_core: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v4 + + #- name: Check core qtil (src) pack + # id: check_version + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # PUBLISHED_VERSION=$(gh api /orgs/advanced-security/packages/container/qtil/versions --jq '.[0].metadata.container.tags[0]') + # CURRENT_VERSION=$(grep version src/qlpack.yml | awk '{print $2}') + # echo "Published version: $PUBLISHED_VERSION" + # echo "Local version: $CURRENT_VERSION" + # if [ "$PUBLISHED_VERSION" != "$CURRENT_VERSION" ]; then + # echo "publish=true" >> $GITHUB_OUTPUT + # fi + - name: Setup CodeQL + # if: steps.check_version.outputs.publish == 'true' + uses: ./.github/actions/install-codeql + + - name: Publish core qtil (src) pack. + # if: steps.check_version.outputs.publish == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "Publishing pack 'qtil'." + codeql pack install "src" + codeql pack publish --dry-run "src" + + publish_langs: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + strategy: + fail-fast: false + matrix: + lang: ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "swift"] + + steps: + - uses: actions/checkout@v4 + + #- name: Check qtil-LANG (src) pack + # id: check_version + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # PUBLISHED_VERSION=$(gh api /orgs/advanced-security/packages/container/qtil-${{ matrix.language }}/versions --jq '.[0].metadata.container.tags[0]') + # CURRENT_VERSION=$(grep version ${{ matrix.language }}/src/qlpack.yml | awk '{print $2}') + # echo "Published version: $PUBLISHED_VERSION" + # echo "Local version: $CURRENT_VERSION" + # if [ "$PUBLISHED_VERSION" != "$CURRENT_VERSION" ]; then + # echo "publish=true" >> $GITHUB_OUTPUT + # fi + - name: Setup CodeQL + # if: steps.check_version.outputs.publish == 'true' + uses: ./.github/actions/install-codeql + + - name: Publish qtil-LANG (src) pack. + # if: steps.check_version.outputs.publish == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "Publishing pack 'qtil-${{ matrix.language }}'." + codeql pack install "${{ matrix.language }}/src" + codeql pack publish --dry-run "${{ matrix.language }}/src" \ No newline at end of file From d1db3499441a91c845901578117c52e35c2ffcda Mon Sep 17 00:00:00 2001 From: Mike Fairhurst Date: Mon, 21 Jul 2025 11:47:22 -0700 Subject: [PATCH 2/3] Address copilot review --- .github/actions/publish/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/publish/publish.yml b/.github/actions/publish/publish.yml index b8625c7..405e8c3 100644 --- a/.github/actions/publish/publish.yml +++ b/.github/actions/publish/publish.yml @@ -54,12 +54,12 @@ jobs: strategy: fail-fast: false matrix: - lang: ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "swift"] + language: ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "swift"] steps: - uses: actions/checkout@v4 - #- name: Check qtil-LANG (src) pack + #- name: Check qtil-LANGUAGE (src) pack # id: check_version # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -75,7 +75,7 @@ jobs: # if: steps.check_version.outputs.publish == 'true' uses: ./.github/actions/install-codeql - - name: Publish qtil-LANG (src) pack. + - name: Publish qtil-LANGUAGE (src) pack. # if: steps.check_version.outputs.publish == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a235806dec5c383266d89278678edfc30a657aee Mon Sep 17 00:00:00 2001 From: Mike Fairhurst Date: Mon, 21 Jul 2025 11:54:50 -0700 Subject: [PATCH 3/3] Additional copilot feedback --- .github/actions/publish/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/publish/publish.yml b/.github/actions/publish/publish.yml index 405e8c3..0dd2f6d 100644 --- a/.github/actions/publish/publish.yml +++ b/.github/actions/publish/publish.yml @@ -35,7 +35,7 @@ jobs: # if: steps.check_version.outputs.publish == 'true' uses: ./.github/actions/install-codeql - - name: Publish core qtil (src) pack. + - name: Publish core qtil (src) pack # if: steps.check_version.outputs.publish == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -54,7 +54,7 @@ jobs: strategy: fail-fast: false matrix: - language: ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "swift"] + language: ["cpp", "csharp", "go", "java", "javascript", "python", "ruby", "swift"] steps: - uses: actions/checkout@v4 @@ -75,7 +75,7 @@ jobs: # if: steps.check_version.outputs.publish == 'true' uses: ./.github/actions/install-codeql - - name: Publish qtil-LANGUAGE (src) pack. + - name: Publish qtil-LANGUAGE (src) pack # if: steps.check_version.outputs.publish == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}