on:
push:
tags:
- 'v*'
name: Create Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
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 }}
create_release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- run: cd 'sqlpage macos-latest' && chmod +x sqlpage && tar --create --file sqlpage-macos.tgz --gzip sqlpage
- run: cd 'sqlpage ubuntu-20.04' && chmod +x sqlpage && tar --create --file sqlpage-linux.tgz --gzip sqlpage
- run: 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 ubuntu-20.04/sqlpage-linux.tgz
sqlpage macos-latest/sqlpage-macos.tgz