From 60f84bdbb9fc4b94f9c432f96bffaa15680f1e12 Mon Sep 17 00:00:00 2001 From: Luis Garcia Date: Sun, 24 Nov 2024 00:59:08 -0700 Subject: [PATCH 1/3] CI: Use binstall for tauri-cli Signed-off-by: Luis Garcia --- .github/workflows/release-osx.yml | 4 +++- .github/workflows/release-windows.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-osx.yml b/.github/workflows/release-osx.yml index 966c665..b4e5ec8 100644 --- a/.github/workflows/release-osx.yml +++ b/.github/workflows/release-osx.yml @@ -14,8 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install Binstall + uses: cargo-bins/cargo-binstall@main - name: install Tauri - run: cargo install tauri-cli --profile dev + run: cargo binstall tauri-cli --no-confirm - name: npm install (desktop) working-directory: desktop run: npm install diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 14779fe..c2f69af 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -13,8 +13,10 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - name: Install Binstall + uses: cargo-bins/cargo-binstall@main - name: install Tauri - run: cargo install tauri-cli --profile dev + run: cargo binstall tauri-cli --no-confirm - name: npm install (desktop) working-directory: desktop run: npm install From 8ec6b11c8e3d342c903d7299b224cbdf9c6e6760 Mon Sep 17 00:00:00 2001 From: Luis Garcia Date: Sun, 24 Nov 2024 01:08:47 -0700 Subject: [PATCH 2/3] CI: Spacing between commands Signed-off-by: Luis Garcia --- .github/workflows/release-linux.yml | 1 + .github/workflows/release-osx.yml | 5 +++++ .github/workflows/release-windows.yml | 6 ++++++ .github/workflows/test.yml | 11 +++++++++++ 4 files changed, 23 insertions(+) diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml index 06bf9b6..d3ea842 100644 --- a/.github/workflows/release-linux.yml +++ b/.github/workflows/release-linux.yml @@ -16,6 +16,7 @@ jobs: platform: [linux/arm/v7, linux/amd64, linux/arm64] steps: - uses: actions/checkout@v4 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 id: builder1 diff --git a/.github/workflows/release-osx.yml b/.github/workflows/release-osx.yml index b4e5ec8..79f5192 100644 --- a/.github/workflows/release-osx.yml +++ b/.github/workflows/release-osx.yml @@ -16,11 +16,14 @@ jobs: - name: Install Binstall uses: cargo-bins/cargo-binstall@main + - name: install Tauri run: cargo binstall tauri-cli --no-confirm + - name: npm install (desktop) working-directory: desktop run: npm install + - name: npm install (librqbit/webui) working-directory: crates/librqbit/webui run: npm install @@ -30,6 +33,7 @@ jobs: run: rustup target add aarch64-apple-darwin && rustup target add x86_64-apple-darwin && cargo tauri build --target universal-apple-darwin --ci + - uses: softprops/action-gh-release@v1 with: generate_release_notes: true @@ -44,6 +48,7 @@ jobs: cargo build --profile release-github --target x86_64-apple-darwin && cargo build --profile release-github --target aarch64-apple-darwin && lipo ./target/x86_64-apple-darwin/release-github/rqbit ./target/aarch64-apple-darwin/release-github/rqbit -create -output ./target/artifacts/rqbit-osx-universal + - uses: softprops/action-gh-release@v1 with: generate_release_notes: true diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index c2f69af..bd6a02d 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -13,13 +13,17 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - name: Install Binstall uses: cargo-bins/cargo-binstall@main + - name: install Tauri run: cargo binstall tauri-cli --no-confirm + - name: npm install (desktop) working-directory: desktop run: npm install + - name: npm install (librqbit/webui) working-directory: crates/librqbit/webui run: npm install @@ -27,6 +31,7 @@ jobs: - name: cargo tauri build working-directory: desktop run: cargo tauri build --ci + - uses: softprops/action-gh-release@v1 with: generate_release_notes: true @@ -35,6 +40,7 @@ jobs: - name: Build release run: cargo build --profile release-github + - uses: softprops/action-gh-release@v1 with: generate_release_notes: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9ba72d..6896834 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,13 +19,19 @@ jobs: - name: rustup toolchain install ${{ matrix.rust_version }} run: | rustup toolchain install ${{ matrix.rust_version }} + - uses: actions/checkout@v4 + - run: rustup override set ${{ matrix.rust_version }} + - run: rustup component add rustfmt + - name: cargo check run: cargo check + - name: cargo fmt --check run: cargo fmt --check + test: strategy: matrix: @@ -33,16 +39,21 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - run: rustup toolchain install stable --profile minimal + - uses: Swatinem/rust-cache@v2 with: prefix-key: v1 + - name: Run tests if: ${{ matrix.os == 'windows-latest' }} run: cargo test --workspace + - name: Run tests if: ${{ matrix.os == 'macos-latest' }} run: ulimit -n unlimited && cargo test --workspace + - name: Run tests if: ${{ matrix.os == 'ubuntu-latest' }} run: cargo test From 68e1c5649e42a95fb6186b77a55feb47c955f069 Mon Sep 17 00:00:00 2001 From: Luis Garcia Date: Fri, 7 Mar 2025 17:53:12 -0700 Subject: [PATCH 3/3] CI: Linux: Dont fail if dockerhub_username is not set Signed-off-by: Luis Garcia --- .github/workflows/release-linux.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml index d3ea842..3149e39 100644 --- a/.github/workflows/release-linux.yml +++ b/.github/workflows/release-linux.yml @@ -95,7 +95,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ikatson/rqbit + ${{ vars.DOCKERHUB_USERNAME }}/rqbit, enable=${{ vars.DOCKERHUB_USERNAME != '' }} tags: | type=ref,event=branch type=semver,pattern={{version}} @@ -120,6 +120,8 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub + if: "${{ vars.DOCKERHUB_USERNAME != '' }}" + id: docker_login uses: docker/login-action@v3 with: username: ${{ vars.DOCKERHUB_USERNAME }} @@ -128,7 +130,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v6 with: - push: true + push: ${{ steps.docker_login.outcome == 'success' }} tags: ${{ steps.meta.outputs.tags }} platforms: linux/amd64,linux/arm64,linux/arm/v7 context: target/cross/