diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml new file mode 100644 index 0000000..96ff4a4 --- /dev/null +++ b/.github/workflows/build-and-release.yml @@ -0,0 +1,48 @@ +name: "Build and Release" +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + build-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - name: Cache cargo builds + uses: actions/cache@v2 + with: + path: | + target + ~/.cargo/ + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + - name: Build Release + uses: actions-rs/cargo@v1 + with: + use-cross: false + command: build + args: --release --target x86_64-unknown-linux-gnu + - name: Move binaries + run: mv target/x86_64-unknown-linux-gnu/release/tobi-rs target/tobi-rs-linux-x86_64 + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: tobi-rs-linux-x86_64 + path: target/tobi-rs-linux-x86_64 + - name: publish release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + LICENSE + target/tobi-rs-linux-x86_64 \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bfc9164 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build and Test + +on: + workflow_dispatch: + push: + branches: [ main, develop, actions ] + pull_request: + branches: [ main, develop, actions ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - name: Cache build data + uses: actions/cache@v2 + with: + path: | + target + ~/.cargo/ + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..9de0495 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "nightly" +targets = [ + "x86_64-unknown-linux-gnu", +] \ No newline at end of file