Skip to content

chore(release): 0.4.0 #1

chore(release): 0.4.0

chore(release): 0.4.0 #1

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 0.2.0)'
required: true
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Build workspace
run: cargo build --workspace --all-features --release
- name: Run all tests
run: cargo test --workspace --all-features
- name: Run integration tests
run: cargo test --workspace --all-features --test '*'
create-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [test]
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: version
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
fi
- name: Generate changelog
id: changelog
run: |
# Get commits since last tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
CHANGELOG=$(git log --pretty=format:"* %s (%h)" $PREV_TAG..HEAD)
else
CHANGELOG=$(git log --pretty=format:"* %s (%h)" -20)
fi
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.version.outputs.version }}
body: |
## What's Changed
${{ steps.changelog.outputs.changelog }}
## Installation
**Rust:**
```toml
[dependencies]
solverforge-core = "${{ steps.version.outputs.version }}"
```
**Python:**
```bash
pip install solverforge==${{ steps.version.outputs.version }}
```
**Maven:**
```xml
<dependency>
<groupId>org.solverforge</groupId>
<artifactId>solverforge-wasm-service</artifactId>
<version>${{ steps.version.outputs.version }}</version>
</dependency>
```
draft: false
prerelease: ${{ contains(steps.version.outputs.version, '-') }}