diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..ae5e89e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,40 @@ +name: CI/CD + +on: + push: + branches: [master] + tags: [v*.*.*] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@v2 + - name: Build + uses: docker://rust:1.42.0-buster + with: + args: /bin/sh -c "cargo test && cargo build --release" + - name: Create a Release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: "" + draft: false + - name: Upload a Release Asset + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./target/release/base + asset_name: base-linux-amd64 + asset_content_type: application/octet-stream diff --git a/src/main.rs b/src/main.rs index f6c353a..fe315e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use lib::base_to_base; fn main() { let matches = clap_app!(base_converter => - (version: "1.0") + (version: "1.0.0") (about: "Convert numbers from any to any base") (@arg NUMBER: +required "Number to be converted from FROM_BASE to TO_BASE") (@arg FROM_BASE: +required "Base in which NUMBER is converted from")