Skip to content

update dependencies #127

update dependencies

update dependencies #127

Workflow file for this run

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
branches:
- "release-test"
name: Create Release
permissions:
contents: write
actions: read
jobs:
build-macos-windows:
name: Build sqlpage binaries (macOS & Windows)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
include:
- os: windows-latest
binary_extension: .exe
target: x86_64-pc-windows-msvc
features: ""
- os: macos-latest
target: x86_64-apple-darwin
features: "odbc-static"
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Set up cargo cache
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
- name: Build
run: cargo build --profile superoptimized --locked --target ${{ matrix.target }} --features "${{ matrix.features }}"
- name: Upload unsigned Windows artifact
if: matrix.os == 'windows-latest'
id: upload_unsigned
uses: actions/upload-artifact@v4
with:
name: unsigned-windows
path: target/${{ matrix.target }}/superoptimized/sqlpage.exe
if-no-files-found: error
- name: Submit signing request to SignPath
if: matrix.os == 'windows-latest'
id: signpath
uses: signpath/[email protected]
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: '45fd8443-c7ca-4d29-a68b-608948185335'
project-slug: 'sqlpage'
signing-policy-slug: 'release-signing'
github-artifact-id: ${{ steps.upload_unsigned.outputs.artifact-id }}
wait-for-completion: true
output-artifact-directory: './signed-windows'
wait-for-completion-timeout-in-seconds: 7200
service-unavailable-timeout-in-seconds: 1800
download-signed-artifact-timeout-in-seconds: 1800
- name: Upload signed Windows artifact
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: sqlpage windows-latest
path: signed-windows/sqlpage.exe
if-no-files-found: error
- name: Upload artifact (non-Windows)
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: sqlpage ${{ matrix.os }}
path: target/${{ matrix.target }}/superoptimized/sqlpage${{ matrix.binary_extension }}
if-no-files-found: error
build-linux:
name: Build sqlpage binaries (Linux)
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: Set up cargo cache
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
- name: Build
run: cargo build --profile superoptimized --locked --target x86_64-unknown-linux-gnu --features "odbc-static"
- uses: actions/upload-artifact@v4
with:
name: sqlpage ubuntu-latest
path: target/x86_64-unknown-linux-gnu/superoptimized/sqlpage
if-no-files-found: error
build-aws:
name: Build AWS Lambda Serverless zip image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v4
with:
name: sqlpage aws lambda serverless image
path: sqlpage-aws-lambda.zip
create_release:
name: Create Github Release
needs: [build-macos-windows, build-linux, build-aws]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- run: |
rm -rf sqlpage/templates/*.handlebars;
chmod +x sqlpage*/sqlpage;
mv 'sqlpage macos-latest/sqlpage' sqlpage.bin;
tar --create --file sqlpage-macos.tgz --gzip sqlpage.bin sqlpage/sqlpage.json sqlpage/migrations sqlpage/templates sqlpage/sqlpage.json;
mv 'sqlpage ubuntu-latest/sqlpage' sqlpage.bin;
tar --create --file sqlpage-linux.tgz --gzip sqlpage.bin sqlpage/migrations sqlpage/templates sqlpage/sqlpage.json;
mv 'sqlpage windows-latest/sqlpage.exe' .
zip -r sqlpage-windows.zip sqlpage.exe sqlpage/migrations sqlpage/templates sqlpage/sqlpage.json;
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
draft: false
prerelease: ${{ contains(github.ref_name, 'beta') }}
files: |
sqlpage-windows.zip
sqlpage-linux.tgz
sqlpage-macos.tgz
sqlpage aws lambda serverless image/sqlpage-aws-lambda.zip
cargo_publish:
name: Publish to crates.io
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}