name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
platform: macos-arm64
target: aarch64-apple-darwin
ext: ''
- os: macos-latest
platform: macos-x86_64
target: x86_64-apple-darwin
ext: ''
- os: ubuntu-latest
platform: linux-x86_64
target: x86_64-unknown-linux-gnu
ext: ''
- os: windows-latest
platform: windows-x86_64
target: x86_64-pc-windows-msvc
ext: '.exe'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build release
run: |
cargo build --release --target ${{ matrix.target }}
mv target/${{ matrix.target }}/release/sql5 target/${{ matrix.target }}/release/sql5${{ matrix.ext }}
- name: Upload asset
uses: softprops/upload-gh-release@v1
with:
files: target/${{ matrix.target }}/release/sql5${{ matrix.ext }}
asset_name: sql5-${{ matrix.platform }}${{ matrix.ext }}
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install build
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}