diff --git a/.github/workflows/build-rust.yml b/.github/workflows/build-rust.yml new file mode 100644 index 0000000..3f86044 --- /dev/null +++ b/.github/workflows/build-rust.yml @@ -0,0 +1,23 @@ +name: Rust + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: Swatinem/rust-cache@v1.0.1 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..57099ec --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: Publish + +on: + push: + branches: [ release ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: Swatinem/rust-cache@v1.0.1 + - name: Build + run: cargo build --release --verbose + - name: Run tests + run: cargo test --verbose + - name: Publish crate + run: cargo publish --manifest-path kalk/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose + - name: Publish CLI + run: cargo publish --manifest-path kalk_cli/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose + + release: + name: release ${{ matrix.target }} + runs-on: ${{ matrix.target }} + strategy: + matrix: + target: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@master + - name: Compile and release + uses: PaddiM8/rust-build.action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EXTRA_FILES: "README.md LICENSE" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 16e8b98..0000000 --- a/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -language: rust -jobs: - include: - - stage: compile - if: branch = master - cache: cargo - before_install: - - rustup component add rustfmt --toolchain stable-x86_64-unknown-linux-gnu - script: - - cargo build --verbose --all - on: - branch: master - - - stage: test - if: branch = master - cache: cargo - script: cargo test --verbose --all - on: - branch: master - - - stage: deploy-releases - cache: cargo - if: branch = release - script: cargo build --verbose --manifest-path kalk_cli/Cargo.toml --release - deploy: - provider: releases - api_key: - secure: "eM+8mEZkCSACjZvN0lH31CA+fCPcTZ+oLu1y+IuQC4MMb8mD8CgV0Y+MXZZA1oLiIrUc6y4zU3ll6pjnU3RGzvlFEB2GPyctxct/a7/zJ3jaVjjFJbssBuCaKN+JTH2AK8530hOfpOujYGU68ENx6WEk/EltRJtc4C4ultHrDcX5gi05XPN8p153AFnjUXEdCAQfAA0Oy9w7/9qzidHe79pWMuqdzfCfrZ/JJRdl/mEfS98JJbzoPW2GqO+OoE+R59JN/QnZrMqlieE0yiEk2HXsbW/Mkosg49NFvOXzfQoH3MYX8YPh6xMkEl+szt8WC3rA2WIDqQMwfxr2PDmxB76+4999RAY/PrZ+WLYbCbU6rUVxK7hZ6Ljxxay9341RL04f+5jzs7kLSBZYil3uo61iRITAsgeVGD3aL6HAnOr3RarAo6o0AdtvL3kzI89GFgJLtPeIpvd8Kx7TgQ/a67vdOA577qyoOc40zBZE17zAbq3ybrRn2E3YOwPjNKdg7xULVe6gvfDSFxm5WqTcDdxT9Zna6nEn22ItDylfZfJksyTO+VDTB+nsctmFLzuccEG4xVsg12BMCDoOCXCjlakX18ri3vJea50ekBE3C7XMPiSZ3XboLo2L1dn/rBeeH9bPHEQMHFDwRDaPItxfBXu+L38jE1CMVTA5j030ADg=" - file: - - "target/release/kalk_cli" - skip_cleanup: true - on: - repo: PaddiM8/kalk - branch: release - - - stage: deploy-cargo - allowallow_failures: true - cache: cargo - script: cd kalk - if: branch = release - deploy: - provider: cargo - token: - secure: "YsnbCBywb3A4ACcCQc3ATHWVpsmoZtyJUIH5Q3MAb1qdaQtX7V/zPtsew0ZvIcL5jo0RPKOvTQaREvC2ShQPImn/LUoBY/DwutUvxFVLbU2Caubn0IUMYBZ/jD8AuQ6mEDn5DU/ieNH1sl0Z4+2itWwHVJsWhSQOINBQUUfSa88oMeFT6aSI1nWbg2ssYRP3+GaSH2pGWbc+LyBnbO2ChxWZ2qZZg4xRdtxJdL7ksConl5w8ALNvdF2rkgDyMgpkAE4GhOPdnxN5YOOhoGFDJWDjbXvFRPBjnnCd9TkZPbuT/GNOBcRdrA3udZf4nBbeL+RGpK3frw8UPABOy4Vuw+TY3REYkWr9bCsaxw2CcJBYN1dN6XnfhBVO6gdsU/8D6+PCz0vVvt+OVO/wNg1MWHI2xjFKWlbRuPyuvgEiv0SOp63bdFJ7kGjJG4KJkFVfVsdXWUhbG4Tm6w7RbrHp5bGPYuxGeiErf3jM6sJmYZlKhQSW5zg4Nh3gZP5jggt9t0MeQnL9Bb65IG8eGF7jT1YSZTJ44tTQPb6nrHgLgeT3KdiObAM87pU4I9QIu27f7dd5JbALHiTEe9YRl5N3VDkf4SPfbi/SsVkr2IrbDft4LJsAAjqOxTTzWk8LRX8XthM8zTwHk9Hdo8mfNw74ao9VMf8HlKZxb3jojIumsyk=" - skip_cleanup: true - on: - repo: PaddiM8/kalk - branch: release - - - stage: deploy-cli-cargo - allowallow_failures: true - cache: cargo - script: cd kalk_cli - if: branch = release - deploy: - provider: cargo - token: - secure: "YsnbCBywb3A4ACcCQc3ATHWVpsmoZtyJUIH5Q3MAb1qdaQtX7V/zPtsew0ZvIcL5jo0RPKOvTQaREvC2ShQPImn/LUoBY/DwutUvxFVLbU2Caubn0IUMYBZ/jD8AuQ6mEDn5DU/ieNH1sl0Z4+2itWwHVJsWhSQOINBQUUfSa88oMeFT6aSI1nWbg2ssYRP3+GaSH2pGWbc+LyBnbO2ChxWZ2qZZg4xRdtxJdL7ksConl5w8ALNvdF2rkgDyMgpkAE4GhOPdnxN5YOOhoGFDJWDjbXvFRPBjnnCd9TkZPbuT/GNOBcRdrA3udZf4nBbeL+RGpK3frw8UPABOy4Vuw+TY3REYkWr9bCsaxw2CcJBYN1dN6XnfhBVO6gdsU/8D6+PCz0vVvt+OVO/wNg1MWHI2xjFKWlbRuPyuvgEiv0SOp63bdFJ7kGjJG4KJkFVfVsdXWUhbG4Tm6w7RbrHp5bGPYuxGeiErf3jM6sJmYZlKhQSW5zg4Nh3gZP5jggt9t0MeQnL9Bb65IG8eGF7jT1YSZTJ44tTQPb6nrHgLgeT3KdiObAM87pU4I9QIu27f7dd5JbALHiTEe9YRl5N3VDkf4SPfbi/SsVkr2IrbDft4LJsAAjqOxTTzWk8LRX8XthM8zTwHk9Hdo8mfNw74ao9VMf8HlKZxb3jojIumsyk=" - skip_cleanup: true - on: - repo: PaddiM8/kalk - branch: release diff --git a/README.md b/README.md index a878108..5067a28 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Crates.io](https://img.shields.io/crates/v/kalk_cli)](https://crates.io/crates/kalk_cli) [![GitHub](https://img.shields.io/github/license/PaddiM8/kalk)](https://github.com/PaddiM8/kalk/blob/master/LICENSE) [![Docs.rs](https://docs.rs/kalk/badge.svg)](https://docs.rs/kalk/latest/kalk/) -![Build status](https://img.shields.io/travis/PaddiM8/kalk/master?label=build%20%26%20test) +![Build status](https://img.shields.io/github/workflow/status/PaddiM8/kalk/Rust?event=push&label=build%20%26%20test) Kalk is a calculator (both program and library) that supports user-defined variables, functions, and units (experimental).