CI
Some checks failed
CI / Typos (pull_request) Successful in 8s
CI / Clippy (pull_request) Successful in 48s
CI / Check version (pull_request) Failing after 3s
CI / Build and test (pull_request) Successful in 53s

This commit is contained in:
2025-05-04 10:26:54 -07:00
parent 42bad8371f
commit 65b60029ae
2 changed files with 52 additions and 0 deletions

View File

@ -52,3 +52,36 @@ jobs:
- name: Test
run: cargo test --release
check-version:
name: Check version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: check version
run: |
# Get base branch (usually main)
BASE_REF="${{ github.base_ref }}"
if [ -z "$BASE_REF" ]; then
BASE_REF="main"
fi
# Get current version
CURRENT_VERSION=$(grep -m 1 '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "Current version: $CURRENT_VERSION"
# Get version from base branch
git fetch origin $BASE_REF
BASE_VERSION=$(git show origin/$BASE_REF:Cargo.toml | grep -m 1 '^version = ' | sed 's/version = "\(.*\)"/\1/')
echo "Base version: $BASE_VERSION"
# Check if version changed
if [ "$CURRENT_VERSION" = "$BASE_VERSION" ]; then
echo "::error::Version in Cargo.toml has not been changed."
exit 1
else
echo "Version has been updated from $BASE_VERSION to $CURRENT_VERSION"
fi

View File

@ -0,0 +1,19 @@
name: Release
on:
push:
branches:
- main
workflow_dispatch:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
id: use-go-action
uses: https://gitea.com/actions/release-action@main
with:
api_key: '${{secrets.RELEASE_TOKEN}}'