diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..83f1548 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,81 @@ +name: CI +on: + push: + tags: + - 'v*.*.*' + branches: + - main + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: false + components: rustfmt, clippy + - name: Check formatting + run: cargo +nightly fmt -- --check + - name: Clippy + run: cargo clippy -- -Dwarnings + - name: Tests + run: cargo test --all-features + publish: + needs: [ build ] + if: "startsWith(github.ref, 'refs/tags/v')" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-is + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - id: get_version + uses: battila7/get-version-action@v2 + - name: Publish crate + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + export VERSION="${{ steps.get_version.outputs.version-without-v }}" + sed -i "s/0.0.0/$VERSION/g" Cargo.toml + cargo publish --all-features --allow-dirty diff --git a/Cargo.lock b/Cargo.lock index 091abce..e9769d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -558,7 +558,7 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "golem-cli" -version = "0.1.0" +version = "0.0.0" dependencies = [ "async-trait", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 1f1692e..08ac17e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "golem-cli" -version = "0.1.0" +version = "0.0.0" edition = "2021" license = "Apache-2.0" homepage = "https://www.golem.cloud/" authors = ["Simon Popugaev "] -readme = false +readme = "README.md" +description = "Command line interface for Golem Cloud" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.md b/README.md new file mode 100644 index 0000000..00ec88d --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# golem-cli + +Command line interface for [Golem Cloud](https://golem.cloud). + + +## Installation + +To install `golem-cli` you currently need to use `cargo`, Rust's build tool. + +To get `cargo` on your system, we recommend to use [rustup](https://rustup.rs/): + +```shell +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +rustup install stable +rustup default stable +``` + +Then you can install `golem-cli` with the following command: + +```shell +cargo install golem-cli +``` + +## More information +Please check the [Golem Cloud developer documentation portal](https://www.golem.cloud/learn) to learn more about how to get started with *Golem Cloud*! \ No newline at end of file