1- name : Publish LISA NPM Package
1+ name : Publish LISA Packages
22on :
33 release :
44 types : [released]
5+ workflow_dispatch :
6+ inputs :
7+ test_mode :
8+ description : ' Test mode (skips npm publish and release upload)'
9+ required : false
10+ type : boolean
11+ default : true
12+ version :
13+ description : ' Version tag for testing'
14+ required : false
15+ type : string
16+ default : ' test-v0.0.0'
517
618permissions :
719 contents : read # Default read-only
@@ -10,19 +22,64 @@ jobs:
1022 PublishLISA :
1123 runs-on : ubuntu-latest
1224 permissions :
13- contents : read
14- packages : write # Required for npm package publishing
25+ contents : write # Required for uploading release assets
26+ id-token : write # Required for npm trusted publishing (OIDC)
1527 steps :
1628 - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
17- # Setup .npmrc file to publish to GitHub Packages
29+ # Setup .npmrc file to publish to NpmJs Packages
1830 - uses : actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v4
1931 with :
2032 node-version : ' 24.x'
21- registry-url : ' https://npm.pkg.github.com'
33+ registry-url : ' https://registry.npmjs.org'
34+
35+ # Setup Python for build scripts
36+ - uses : actions/setup-python@v5
37+ with :
38+ python-version : ' 3.13'
39+
40+ # Install npm dependencies and publish package. Auth is established with NpmJs Trusted publishing.
41+ # To update, modify package at https://www.npmjs.com/package/awslabs-lisa/access
42+ # More info: https://docs.npmjs.com/trusted-publishers
2243 - run : npm ci
23- - run : npm publish
44+ - name : Publish NPM Package
45+ if : github.event_name == 'release' || !inputs.test_mode
46+ run : npm publish
47+ - name : Publish NPM Package (Dry Run)
48+ if : github.event_name == 'workflow_dispatch' && inputs.test_mode
49+ 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
2459 env :
25- NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60+ PYPI_URL : https://pypi.org/simple
61+ LISA_VERSION : ${{ github.event_name == 'release' && github.event.release.tag_name || inputs.version }}
62+
63+ # Upload binary assets to GitHub Release
64+ - name : Upload Release Assets
65+ if : github.event_name == 'release' || !inputs.test_mode
66+ uses : softprops/action-gh-release@v2
67+ with :
68+ files : |
69+ dist/layers/*.zip
70+ dist/images/*.tar
71+ env :
72+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73+
74+ # In test mode, just list what would be uploaded
75+ - name : List Build Artifacts (Test Mode)
76+ if : github.event_name == 'workflow_dispatch' && inputs.test_mode
77+ run : |
78+ echo "=== Lambda Layers (dist/layers/*.zip) ==="
79+ ls -lh dist/layers/*.zip 2>/dev/null || echo "No zip files found"
80+ echo ""
81+ echo "=== Container Images (dist/images/*.tar) ==="
82+ ls -lh dist/images/*.tar 2>/dev/null || echo "No tar files found"
2683
2784 SendSlackNotification :
2885 name : Send Slack Notification
3794 env :
3895 SLACK_WEBHOOK : ${{ secrets.INTERNAL_DEV_SLACK_WEBHOOK_URL }}
3996 SLACK_COLOR : ${{ contains(join(needs.*.result, ' '), 'failure') && 'failure' || 'success' }}
40- SLACK_TITLE : ' NPM Package Published'
97+ SLACK_TITLE : ' LISA Package Published'
4198 SLACK_FOOTER : ' '
4299 MSG_MINIMAL : ' actions url,commit'
43- SLACK_MESSAGE_ON_FAILURE : ' <!here> NPM Package publish FAILED for version ${{ github.event.pull_request.head.ref }}|commit> '
44- SLACK_MESSAGE_ON_SUCCESS : ' NPM Package published SUCCESS for ${{ github.event.pull_request.head.ref }}|commit> .'
45- SLACK_MESSAGE : ' NPM Publish Finished with status ${{ job.status }} for < ${{ github.event.pull_request.head.ref }}|commit> '
100+ SLACK_MESSAGE_ON_FAILURE : ' <!here> LISA Package publish FAILED for version ${{ github.event.release.tag_name }}'
101+ SLACK_MESSAGE_ON_SUCCESS : ' LISA Package published SUCCESS for version ${{ github.event.release.tag_name }} with NPM package and binary assets .'
102+ SLACK_MESSAGE : ' LISA Publish Finished with status ${{ job.status }} for version ${{ github.event.release.tag_name }}'
0 commit comments