v0.2.2 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lambda Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-lambda-artifacts: | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - runner: ubuntu-24.04 | |
| lambda_arch: x86_64 | |
| rust_target: x86_64-unknown-linux-gnu | |
| cargo_lambda_arch_arg: '' | |
| - runner: ubuntu-24.04-arm | |
| lambda_arch: arm64 | |
| rust_target: aarch64-unknown-linux-gnu | |
| cargo_lambda_arch_arg: '--arm64' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.rust_target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-lambda | |
| run: pip install cargo-lambda | |
| - name: Compute artifact version | |
| id: artifact_version | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.event_name }}" == "release" ]]; then | |
| echo "value=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT" | |
| elif [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| echo "value=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Build Lambda zip | |
| run: | | |
| cargo lambda build --release -F state-store-query -p embucket-lambda ${{ matrix.cargo_lambda_arch_arg }} --output-format zip --lambda-dir dist/${{ matrix.lambda_arch }} --flatten bootstrap | |
| cp dist/${{ matrix.lambda_arch }}/bootstrap.zip dist/embucket-lambda-${{ steps.artifact_version.outputs.value }}-${{ matrix.lambda_arch }}.zip | |
| - name: Upload Lambda artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: lambda-${{ steps.artifact_version.outputs.value }}-${{ matrix.lambda_arch }} | |
| path: dist/embucket-lambda-${{ steps.artifact_version.outputs.value }}-${{ matrix.lambda_arch }}.zip | |
| if-no-files-found: error | |
| retention-days: 7 | |
| compression-level: 0 | |
| - name: Attach Lambda asset to GitHub release | |
| if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.artifact_version.outputs.value }} | |
| files: dist/embucket-lambda-${{ steps.artifact_version.outputs.value }}-${{ matrix.lambda_arch }}.zip | |
| overwrite_files: true |