diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec8dc2172..443f4bff0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,17 @@ name: CD Pipeline -on: [push] +on: + push: + branches: + - "master" + tags: + - "*" jobs: build-nix: env: IN_PIPELINE: true runs-on: ${{ matrix.os }} - if: github.ref == 'refs/heads/master' strategy: matrix: type: [ubuntu-x64, ubuntu-x86, armv7, aarch64] @@ -37,37 +41,33 @@ jobs: path: target/aarch64-unknown-linux-gnu/release/rustscan pkg_config_path: /usr/lib/x86_64-linux-gnu/pkgconfig steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Cache cargo & target directories uses: Swatinem/rust-cache@v2 - name: Build binary - uses: houseabsolute/actions-rust-cross@v0 + uses: houseabsolute/actions-rust-cross@v1 with: command: build target: ${{ matrix.target }} args: "--locked --release" strip: true toolchain: stable - - name: Build tar.gz for homebrew installs - if: matrix.type == 'ubuntu-x64' - run: | - tar czf ${{ matrix.name }}.tar.gz -C target/x86_64-unknown-linux-musl/release rustscan - - uses: actions/upload-artifact@v4 + - name: Upload artifacts + uses: houseabsolute/actions-rust-release@v0 with: - name: ${{ matrix.name }} - path: ${{ matrix.path }} - - uses: actions/upload-artifact@v4 - if: matrix.type == 'ubuntu-x64' - with: - name: ${{ matrix.name }}.tar.gz - path: ${{ matrix.name }}.tar.gz + executable-name: rustscan + target: ${{ matrix.target }} + archive-name: ${{ matrix.name }} + changes-file: "" + release-tag-prefix: "disabled" + build-deb: needs: [build-nix] runs-on: ubuntu-latest env: IN_PIPELINE: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install cargo-deb run: cargo install -f cargo-deb - uses: awalsh128/cache-apt-pkgs-action@v1 @@ -79,7 +79,7 @@ jobs: - name: Deb Build run: cargo deb --target=x86_64-unknown-linux-musl - name: Upload Deb Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: rustscan.deb path: ./target/x86_64-unknown-linux-musl/debian/* @@ -88,65 +88,56 @@ jobs: env: IN_PIPELINE: true runs-on: macos-latest - if: github.ref == 'refs/heads/master' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Cache cargo & target directories uses: Swatinem/rust-cache@v2 - name: Build binary - uses: houseabsolute/actions-rust-cross@v0 + uses: houseabsolute/actions-rust-cross@v1 with: command: build target: x86_64-apple-darwin args: "--locked --release" strip: true toolchain: stable - - name: Build tar.gz for homebrew installs - run: | - tar czf x86_64-macos-rustscan.tar.gz -C target/x86_64-apple-darwin/release rustscan - - uses: actions/upload-artifact@v4 - with: - name: x86_64-macos-rustscan - path: target/x86_64-apple-darwin/release/rustscan - - uses: actions/upload-artifact@v4 + - name: Upload artifacts + uses: houseabsolute/actions-rust-release@v0 with: - name: x86_64-macos-rustscan.tar.gz - path: x86_64-macos-rustscan.tar.gz - + executable-name: rustscan + target: x86_64-apple-darwin + archive-name: x86_64-macos-rustscan + changes-file: "" + release-tag-prefix: "disabled" + build-macos-aarch64: env: IN_PIPELINE: true runs-on: macos-latest - if: github.ref == 'refs/heads/master' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Cache cargo & target directories uses: Swatinem/rust-cache@v2 - name: Build binary - uses: houseabsolute/actions-rust-cross@v0 + uses: houseabsolute/actions-rust-cross@v1 with: command: build target: aarch64-apple-darwin args: "--locked --release" strip: true toolchain: stable - - name: Build tar.gz for homebrew installs - run: | - tar czf aarch64-macos-rustscan.tar.gz -C target/aarch64-apple-darwin/release rustscan - - uses: actions/upload-artifact@v4 + - name: Upload artifacts + uses: houseabsolute/actions-rust-release@v0 with: - name: aarch64-macos-rustscan - path: target/aarch64-apple-darwin/release/rustscan - - uses: actions/upload-artifact@v4 - with: - name: aarch64-macos-rustscan.tar.gz - path: aarch64-macos-rustscan.tar.gz + executable-name: rustscan + target: aarch64-apple-darwin + archive-name: aarch64-macos-rustscan + changes-file: "" + release-tag-prefix: "disabled" build-windows: env: IN_PIPELINE: true runs-on: ${{ matrix.os }} - if: github.ref == 'refs/heads/master' strategy: matrix: type: [windows-x64, windows-x86] @@ -154,26 +145,54 @@ jobs: - type: windows-x64 os: windows-latest target: x86_64-pc-windows-msvc - name: x86_64-windows-rustscan.exe - path: target\x86_64-pc-windows-msvc\release\rustscan.exe + name: x86_64-windows-rustscan - type: windows-x86 os: windows-latest target: i686-pc-windows-msvc - name: x86-windows-rustscan.exe - path: target\i686-pc-windows-msvc\release\rustscan.exe + name: x86-windows-rustscan steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Cache cargo & target directories uses: Swatinem/rust-cache@v2 - name: Build binary - uses: houseabsolute/actions-rust-cross@v0 + uses: houseabsolute/actions-rust-cross@v1 with: command: build - target: ${{ matrix.target }} + target: ${{ matrix.target }} args: "--locked --release" strip: true toolchain: stable - - uses: actions/upload-artifact@v4 + - name: Upload artifacts + uses: houseabsolute/actions-rust-release@v0 + with: + executable-name: rustscan + target: ${{ matrix.target }} + archive-name: ${{ matrix.name }} + changes-file: "" + release-tag-prefix: "disabled" + + publish: + if: github.ref_type == 'tag' + needs: + - build-nix + - build-deb + - build-macos + - build-macos-aarch64 + - build-windows + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download build artifacts + uses: actions/download-artifact@v8 + with: + merge-multiple: true + - name: Publish artifacts to GitHub release + if: github.ref_type == 'tag' + uses: softprops/action-gh-release@v2 with: - name: ${{ matrix.name }} - path: ${{ matrix.path }} + files: | + *.deb + *.sha256 + *.tar.gz + *.zip diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 7f9508bde..a21a8dc24 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -1,9 +1,14 @@ name: Dependabot Auto-Merge +on: pull_request + +permissions: + contents: write + pull-requests: write jobs: dependabot: runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'bee-san/RustScan' steps: - name: Enable auto-merge for Dependabot PRs run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 527f907c9..228b91fb3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,20 +15,16 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout sources - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true + run: rustup toolchain install "${{ matrix.rust }}" --profile minimal - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 - name: Install Just - uses: extractions/setup-just@v2 + uses: extractions/setup-just@v3 - name: Run just run: just test