@@ -25,55 +25,72 @@ jobs:
2525 contents : write # Required for uploading release assets
2626 id-token : write # Required for npm trusted publishing (OIDC)
2727 steps :
28- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
28+ # Free up disk space (~30GB+) by removing preinstalled software we don't need
29+ - name : Free disk space
30+ run : |
31+ sudo rm -rf /usr/share/dotnet
32+ sudo rm -rf /usr/local/lib/android
33+ sudo rm -rf /opt/ghc
34+ sudo rm -rf /opt/hostedtoolcache/CodeQL
35+ sudo rm -rf /opt/hostedtoolcache/go
36+ sudo rm -rf /opt/hostedtoolcache/Ruby
37+ sudo rm -rf /usr/local/share/powershell
38+ sudo rm -rf /usr/local/share/chromium
39+ sudo rm -rf /usr/local/lib/heroku
40+ sudo rm -rf /usr/share/swift
41+ sudo docker image prune --all --force
42+ df -h
43+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
2944 # Setup .npmrc file to publish to NpmJs Packages
30- - uses : actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v4
45+ - uses : actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4
3146 with :
3247 node-version : ' 24.x'
3348 registry-url : ' https://registry.npmjs.org'
3449
3550 # Setup Python for build scripts
36- - uses : actions/setup-python@v5
51+ - uses : actions/setup-python@v6
3752 with :
3853 python-version : ' 3.13'
3954
55+
4056 # Install npm dependencies and publish package. Auth is established with NpmJs Trusted publishing.
4157 # To update, modify package at https://www.npmjs.com/package/awslabs-lisa/access
4258 # More info: https://docs.npmjs.com/trusted-publishers
4359 - run : npm ci
60+ # Set version from input when running in test mode
61+ - name : Set test version
62+ if : github.event_name == 'workflow_dispatch'
63+ run : npm version "${{ inputs.version }}" --no-git-tag-version --allow-same-version
4464 - name : Publish NPM Package
45- if : github.event_name == 'release' || ! inputs.test_mode
65+ if : " !( github.event_name == 'workflow_dispatch' && inputs.test_mode == true) "
4666 run : npm publish
4767 - name : Publish NPM Package (Dry Run)
48- if : github.event_name == 'workflow_dispatch' && inputs.test_mode
68+ if : github.event_name == 'workflow_dispatch' && inputs.test_mode == true
4969 run : npm publish --dry-run
50-
51- # Build binary assets (lambda layers and container images)
52- - name : Build Lambda Layers and Container Images
53- run : |
54- # Create build directory for lambda layers
55- mkdir -p build
56-
57- # Build assets (runs build-lambdas and build-images --export)
58- ./bin/build-assets
70+ # Install Python dependencies needed by build scripts
71+ - name : Install Python build dependencies
72+ run : pip install tiktoken==0.12.0
73+ # Build and export container images (separate from npm publish to avoid OOM)
74+ - name : Build Container Images
75+ run : ./bin/build-images --export
5976 env :
6077 PYPI_URL : https://pypi.org/simple
6178 LISA_VERSION : ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.version }}
6279
6380 # Upload binary assets to GitHub Release
6481 - name : Upload Release Assets
65- if : github.event_name == 'release' || ! inputs.test_mode
82+ if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.test_mode == false)
6683 uses : softprops/action-gh-release@v2
6784 with :
85+ tag_name : ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.version }}
6886 files : |
69- dist/layers/*.zip
7087 dist/images/*.tar
7188 env :
7289 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7390
7491 # In test mode, just list what would be uploaded
7592 - name : List Build Artifacts (Test Mode)
76- if : github.event_name == 'workflow_dispatch' && inputs.test_mode
93+ if : github.event_name == 'workflow_dispatch' && inputs.test_mode == true
7794 run : |
7895 echo "=== Lambda Layers (dist/layers/*.zip) ==="
7996 ls -lh dist/layers/*.zip 2>/dev/null || echo "No zip files found"
0 commit comments