Skip to content

Github Actions step to get the current directories crate version as an output variable.

License

Notifications You must be signed in to change notification settings

colt-1/crate-version

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crate-version

This is a Github action, you can use it to extract your Rust crate version. Read more about those here: https://developer.github.com/actions/

Usage

workflow.yml

- name: Crate Version
  id: crate-version
  uses: colathro/[email protected]
  with:
    file: "./Cargo.toml"

Arguments

All arguments are of type string.

Name Required Description Default
file False The relative path of toml file Cargo.toml

Cargo.toml Example

[package]
name = "images"
version = "0.1.0"
edition = "2021"

[dependencies]
rusoto_s3 = "0.48.0"
rusoto_core = "0.48.0"
rusoto_signature = "0.48.0"
rusoto_credential = "0.48.0"
async-trait = "0.1.53"

Output here would be "0.1.0"

Using the output

name: Build My Thing
on: push
jobs:
  Build:
    runs-on: ubuntu-latest
    steps:
      - id: checkout
        uses: actions/checkout@v3

      - name: Crate Version
        id: crate-version
        uses: colathro/[email protected]

      - name: Use Version Output
        run: echo ${{ steps.crate-version.outputs.version }}

Development

Dependencies

npm install

npm i -g @vercel/ncc

Testing

yarn test

Building

ncc build index.js --license licenses.txt

After building check in dist/index.js.

About

Github Actions step to get the current directories crate version as an output variable.

Resources

License

Stars

Watchers

Forks

Packages

No packages published