fix compilation of serverless runtime #30
Workflow file for this run
This file contains 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
on: | |
workflow_dispatch: {} | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
name: Create Release | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# Use an older ubuntu to compile with an older glibc | |
os: [macos-latest, windows-latest, ubuntu-20.04] | |
include: | |
- os: windows-latest | |
binary_path: target/superoptimized/sqlpage.exe | |
- os: macos-latest | |
binary_path: target/superoptimized/sqlpage | |
- os: ubuntu-20.04 | |
binary_path: target/superoptimized/sqlpage | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: release-${{ runner.os }}-check-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: release-${{ runner.os }}-check- | |
- run: cargo build --profile superoptimized --locked | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sqlpage ${{ matrix.os }} | |
path: ${{ matrix.binary_path }} | |
build-aws: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: docker build -t sqlpage-lambda-builder . -f lambda.Dockerfile --target builder | |
- run: docker run sqlpage-lambda-builder cat deploy.zip > sqlpage-aws-lambda.zip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: sqlpage aws lambda serverless image | |
path: sqlpage-aws-lambda.zip | |
create_release: | |
name: Create Release | |
needs: [build, build-aws] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
- run: | | |
chmod +x sqlpage*/sqlpage; | |
mv 'sqlpage macos-latest/sqlpage' sqlpage.bin; | |
tar --create --file sqlpage-macos.tgz --gzip sqlpage.bin; | |
mv 'sqlpage ubuntu-20.04/sqlpage' sqlpage.bin; | |
tar --create --file sqlpage-linux.tgz --gzip sqlpage.bin | |
cd 'sqlpage windows-latest' && zip -r sqlpage-windows.zip *.exe | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ github.ref_name }} | |
tag_name: ${{ github.ref_name }} | |
draft: false | |
files: | | |
sqlpage windows-latest/sqlpage-windows.zip | |
sqlpage-linux.tgz | |
sqlpage-macos.tgz | |
sqlpage aws lambda serverless image/sqlpage-aws-lambda.zip |