From 37060e6cfef39241bea99c56bcb44c285cda5fca Mon Sep 17 00:00:00 2001 From: FranciumSoftware <156525035+FranciumSoftware@users.noreply.github.com> Date: Mon, 24 Aug 2026 18:19:50 +0200 Subject: [PATCH] [NEW] Adding new workflows --- .github/workflows/build.yml | 75 ++++++++++++++++++++++++++++++++ .github/workflows/code_check.yml | 14 ++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/code_check.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1b87b52 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +name: Build and Package + +on: + release: + types: [created] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + package: deb + - os: macos-latest + target: x86_64-apple-darwin + package: dmg + - os: windows-latest + target: x86_64-pc-windows-msvc + package: msi + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Build + run: cargo build --release --target ${{ matrix.target }} + + - name: Package (Linux) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get install -y dpkg + cargo install cargo-deb + cargo deb --target ${{ matrix.target }} + + - name: Package (macOS) + if: matrix.os == 'macos-latest' + run: | + cargo install cargo-bundle + cargo bundle --release --target ${{ matrix.target }} + + - name: Package (Windows) + if: matrix.os == 'windows-latest' + run: | + cargo install cargo-wix + cargo wix --no-build + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./target/${{ matrix.target }}/release/*.${{ matrix.package }} + asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-${{ matrix.target }}.${{ matrix.package }} + asset_content_type: application/octet-stream diff --git a/.github/workflows/code_check.yml b/.github/workflows/code_check.yml new file mode 100644 index 0000000..833b05b --- /dev/null +++ b/.github/workflows/code_check.yml @@ -0,0 +1,14 @@ +on: + pull_request: + types: [opened, reopened] + branches: + - develop +jobs: + check_code: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + - run: cargo check