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/
workflow.yml
- name: Crate Version
id: crate-version
uses: colathro/[email protected]
with:
file: "./Cargo.toml"
All arguments are of type string.
Name | Required | Description | Default |
---|---|---|---|
file | False | The relative path of toml file | Cargo.toml |
[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"
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 }}
npm install
npm i -g @vercel/ncc
yarn test
ncc build index.js --license licenses.txt
After building check in dist/index.js.