name: Build env: include_paths: | charsets/ docs/ extra/ layouts/ masks/ modules/ OpenCL/ rules/ example* hashcat* libhashcat* on: push: branches: - master tags: - v* paths: - 'OpenCL/**.h' - 'OpenCL/**.cl' - 'include/**.h' - 'src/**.c' - 'tools/**' - '**/Makefile' - '.github/workflows/build.yml' pull_request: branches: - master paths: - 'OpenCL/**.h' - 'OpenCL/**.cl' - 'include/**.h' - 'src/**.c' - 'tools/**' - '**/Makefile' - '.github/workflows/build.yml' jobs: build: strategy: fail-fast: false matrix: shared: [0, 1] include: - os: ubuntu-latest os_name: Linux os_name_lowercase: linux - os: macos-latest os_name: MacOS os_name_lowercase: macos - os: windows-latest os_name: Windows os_name_lowercase: windows name: Build ${{ matrix.os_name }} (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install dependencies (Windows only) if: matrix.os_name_lowercase == 'windows' uses: msys2/setup-msys2@v2 with: update: true install: | gcc git libiconv libiconv-devel make - name: Build if: matrix.os_name_lowercase == 'windows' shell: msys2 {0} env: SHARED: ${{ matrix.shared }} run: make - name: Build if: matrix.os_name_lowercase != 'windows' env: SHARED: ${{ matrix.shared }} run: make - name: Generate artifacts uses: actions/upload-artifact@v4 with: name: hashcat-${{ matrix.os_name_lowercase }}-${{ matrix.shared == 0 && 'static' || 'shared' }} path: ${{ env.include_paths }}