Skip to content

Commit ae71c0b

Browse files
authored
chore: GHA fixes (#2636)
Updates the GitHub Actions workflows to change how build artifacts are produced/consumed (separating the VSIX and npm packages) and to bump the artifact download action version used across CI and post-processing. **Changes:** - Replace a single “build zip” artifact upload with separate uploads for the VSIX and each npm package. - Update `download-artifact` usage in CI and post workflows to `@v8`, and update release/publish steps to download by pattern. - Adjust npm publishing step to publish all matching `@ansible-*.tgz` files.
1 parent 5df9ede commit ae71c0b

3 files changed

Lines changed: 44 additions & 36 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
runs:
99
using: "composite"
1010
steps:
11-
- uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
11+
- uses: jdx/mise-action@v3
1212
with:
1313
experimental: true
1414
# without specific version here will not upgrade old existing versions

.github/workflows/ci.yaml

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ jobs:
5151
continue-on-error: false
5252
outputs:
5353
commit_context: ${{ steps.extract_context.outputs.context }}
54-
builder_files: ${{ steps.paths.outputs.builder_files }}
5554
steps:
5655
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5756
with:
@@ -62,19 +61,6 @@ jobs:
6261
run: |
6362
chown -R $(id -u):$(id -g) $PWD
6463
65-
- name: Check for builder-related file changes
66-
id: paths
67-
uses: dorny/paths-filter@v3
68-
with:
69-
filters: |
70-
builder_files:
71-
- .config/mise.toml
72-
- .git/workflows/ci.yaml
73-
- Containerfile
74-
- pyproject.toml
75-
- tools/builder.sh
76-
- uv.lock
77-
7864
- name: task setup
7965
timeout-minutes: 7 # expected under 10s for container builds
8066
run: |
@@ -154,14 +140,27 @@ jobs:
154140
- name: task finish
155141
run: task finish
156142

157-
- name: Upload packages archive
158-
uses: ansible/actions/upload-artifact@main
143+
- name: Upload vsix artifact
144+
uses: actions/upload-artifact@v7
159145
with:
160-
# Do not use github.ref_name as it contains slashes and we cannot sanitize it
161-
name: ansible-extension-build-${{ github.event.number || github.run_id }}.zip
162-
path: |
163-
out/ansible-*.vsix
164-
out/*.tgz
146+
path: out/ansible-*.vsix
147+
archive: false
148+
if-no-files-found: error
149+
retention-days: 90
150+
151+
- name: Upload @ansible-ansible-language-server npm package
152+
uses: actions/upload-artifact@v7
153+
with:
154+
path: out/@ansible-ansible-language-server-*.tgz
155+
archive: false
156+
if-no-files-found: error
157+
retention-days: 90
158+
159+
- name: Upload @ansible-ansible-mcp-server npm package
160+
uses: actions/upload-artifact@v7
161+
with:
162+
path: out/@ansible-ansible-mcp-server-*.tgz
163+
archive: false
165164
if-no-files-found: error
166165
retention-days: 90
167166

@@ -445,11 +444,6 @@ jobs:
445444
builder-image:
446445
runs-on: ubuntu-24.04
447446
needs: [preflight]
448-
if: >
449-
needs.preflight.outputs.builder_files == 'true' ||
450-
github.ref_type == 'tag' ||
451-
(github.event_name == 'release' && github.event.action == 'published') ||
452-
github.event.inputs.publish == 'true'
453447
permissions:
454448
contents: read
455449
packages: write
@@ -499,7 +493,7 @@ jobs:
499493
uses: astral-sh/setup-uv@v7
500494

501495
- name: Download artifacts
502-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
496+
uses: actions/download-artifact@v8
503497
with:
504498
path: .
505499

@@ -581,12 +575,13 @@ jobs:
581575
corepack enable
582576
npm config set fund false
583577
584-
- uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
578+
- uses: jdx/mise-action@v3
585579

586580
- name: Download the artifact
587-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
581+
uses: actions/download-artifact@v8
588582
with:
589-
name: ansible-extension-build-${{ github.event.number || github.run_id }}.zip
583+
pattern: "ansible-*.vsix"
584+
skip-decompress: true
590585
path: out
591586

592587
- name: Attach vsix to Github release
@@ -629,14 +624,27 @@ jobs:
629624
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
630625

631626
- name: Download the artifact
632-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
627+
uses: actions/download-artifact@v8
633628
with:
634-
name: ansible-extension-build-${{ github.event.number || github.run_id }}.zip
629+
pattern: "@ansible-*.tgz"
630+
skip-decompress: true
631+
merge-multiple: true
635632
path: out
636633

637-
- uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
634+
- name: Attach npm package to Github release
635+
# cspell: ignore softprops
636+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
637+
if: github.ref_type == 'tag'
638+
with:
639+
files: "out/*.tgz"
638640

639-
- run: npm publish --access public out/@ansible-ansible-language-server-*.tgz
641+
- uses: jdx/mise-action@v3
642+
643+
- name: Publish npm packages to npmjs.com
644+
run: |
645+
for file in out/@ansible-*.tgz; do
646+
npm publish --access public "$file"
647+
done
640648
env:
641649
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
642650

.github/workflows/post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
repository: ${{ github.event.workflow_run.head_repository.full_name }}
4646

4747
- name: Download artifacts (coverage reports)
48-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
48+
uses: actions/download-artifact@v8
4949
with:
5050
pattern: logs-*.zip
5151
path: .

0 commit comments

Comments
 (0)