Skip to content

Update README.md

Update README.md #24

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
packages: write
actions: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Format
run: cargo fmt
- name: Build
run: cargo build --verbose
- name: Run Check
run: cargo check --verbose
- name: Run tests
run: cargo test --verbose
- name: Run benchmarks
run: cargo bench --verbose
- name: Get Latest Tag
id: get_latest_tag
uses: actions/github-script@v6
with:

Check failure on line 37 in .github/workflows/rust.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/rust.yml

Invalid workflow file

You have an error in your yaml syntax on line 37
script: |
if (github && github.repos && typeof github.repos.listTags === 'function') {
const tags = await github.repos.listTags({
owner: context.repo.owner,
repo: context.repo.repo
});
if (tags.data.length === 0) {
core.setOutput('tag', 'v0.0.0'); // Default to v0.0.0 if no tags exist
} else {
core.setOutput('tag', tags.data[0].name);
}
} else {
core.setOutput('tag', 'v0.0.0'); // Fallback if listTags is unavailable
}
- name: Increment Tag
id: increment_tag
run: |
# Extract the latest tag
latest_tag=${{ steps.get_latest_tag.outputs.tag }}
# Increment the version (patch level as an example)
IFS='.' read -ra VERSION <<< "${latest_tag#v}"
major=${VERSION[0]}
minor=${VERSION[1]}
patch=${VERSION[2]}
patch=$((patch + 1))
new_tag="v${major}.${minor}.${patch}"
echo "new_tag=${new_tag}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.new_tag }}
release_name: Release ${{ env.new_tag }}
draft: false
prerelease: false
- name: Upload to GitHub Packages
uses: actions/upload-artifact@v4
with:
name: rust-artifact
path: target/release/splitr # Update this to the actual path of your artifact