diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bdf63ad --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + - name: Run Clippy + run: cargo clippy -- -D warnings diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml new file mode 100644 index 0000000..39340cb --- /dev/null +++ b/.github/workflows/publish_release.yml @@ -0,0 +1,64 @@ +name: Publish Release + +on: + push: + tags: + - "*" + +jobs: + rustfmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup component add rustfmt + - run: cargo fmt -- --check + + build-linux: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build for Linux + run: cargo build --all --release && strip target/release/ftu + + - name: Get FTU version + id: ftu_version + uses: dante-signal31/rust-app-version@v1.2.0 + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@2.7.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/ftu + asset_name: ftu-x86_64-unknown-linux-gnu + tag: ${{ github.ref }} + release_name: ${{ github.ref }} + body: "FTU release ${{ github.ref }}" + overwrite: true + + build-mac: + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build for Mac + run: cargo build --all --release && strip target/release/ftu + + - name: Get FTU version + id: ftu_version + uses: dante-signal31/rust-app-version@v1.2.0 + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@2.7.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/ftu + asset_name: ftu-x86_64-apple-darwin + tag: ${{ github.ref }} + release_name: ${{ github.ref }} + body: "FTU release ${{ github.ref }}" + overwrite: true diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 00b6dec..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,24 +0,0 @@ -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@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - - name: Run Clippy - run: cargo clippy -- -D warnings diff --git a/Cargo.toml b/Cargo.toml index b7b51af..2dc3364 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ftu" -version = "0.1.0" +version = "1.0.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.md b/README.md index 25d3191..e08615d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Rust](https://github.com/amarula/ftu/actions/workflows/rust.yml/badge.svg)](https://github.com/amarula/ftu/actions/workflows/rust.yml) +[![Build](https://github.com/amarula/ftu/actions/workflows/build.yml/badge.svg)](https://github.com/amarula/ftu/actions/workflows/build.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) # ftu - Flutter Translation Utility