Skip to content

Commit ce24e93

Browse files
authored
add action to attach lambda zips to release (#1015)
* add action to attach lambda zips to release * update changelog * Create single zip file with all lambdas * fix env var setting in gh action * use github context instead of pulling version from npm * build lambdas in prod mode * get node version from step output * remove subshell from lambda dist build script * fix all webpack configs * upgrade packages to pass audit * revert to getting package version from npm * add shell quotes
1 parent aa2fa51 commit ce24e93

File tree

10 files changed

+152
-29
lines changed

10 files changed

+152
-29
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build lambda dist zip
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build-lambda-dist:
10+
env:
11+
PRODUCTION: "true"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
- uses: actions/setup-node@v4
16+
id: setup-node
17+
with:
18+
node-version-file: ".nvmrc"
19+
cache: npm
20+
cache-dependency-path: package.json
21+
- name: Upgrade npm
22+
run: npm install -g npm@10
23+
- name: Install dependencies
24+
run: npm install
25+
- name: Get stac-server version
26+
run: echo "STAC_SERVER_VERSION=$(npm pkg get version | tr -d '\"')" >> "$GITHUB_ENV"
27+
- name: Check that release tag name matches JS package version
28+
run: test "$STAC_SERVER_VERSION" = "$GITHUB_REF_NAME"
29+
- name: Run build
30+
run: npm run build-lambda-dist
31+
- name: Create zipfile path
32+
run: |
33+
DIST_ZIP_PATH=$(printf "stac-server-lambda-dist_%s_node-%s.zip" $STAC_SERVER_VERSION ${{ steps.setup-node.outputs.node-version }})
34+
echo "DIST_ZIP_PATH=$DIST_ZIP_PATH" >> "$GITHUB_ENV"
35+
- name: Rename zipfiles
36+
run: |
37+
mv dist/lambda-dist/lambda-dist.zip "$DIST_ZIP_PATH"
38+
- name: Add to release
39+
uses: softprops/action-gh-release@v2
40+
if: startsWith(github.ref, 'refs/tags')
41+
with:
42+
files: ${{ env.DIST_ZIP_PATH }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- New Github Action that attaches zip archives of lambdas to releases.
1013
### Changed
1114

1215
- **Documentation Overhaul**: Migrated all documentation to a new MkDocs-powered documentation website at [stac-utils.github.io/stac-server](https://stac-utils.github.io/stac-server/)

bin/build-lambda-dist.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd src/lambdas
6+
webpack

0 commit comments

Comments
 (0)