getting version in gh actions

This commit is contained in:
2025-10-24 23:28:35 +02:00
parent 89d921299e
commit 98e11b9da1

32
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Docker
on:
push:
branches: [ "main" ]
paths:
- 'Cargo.toml'
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: |
apt install -y nu
version=$(nu -c "cargo metadata --format-version=1 --no-deps | from json | get packages | first | get version")
echo $version
- name: Run tests
run: cargo test --verbose
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: |
cargo publish --verbose