From c7965208d4454443f0ac4d83974a85a39a3e9aab Mon Sep 17 00:00:00 2001 From: Matt <5032824+mdawsonuk@users.noreply.github.com> Date: Thu, 14 Jul 2022 17:11:57 +0100 Subject: [PATCH 1/3] Add artifacts to GitHub Actions pipeline --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a3827ba2..13ac438c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,18 @@ name: Build +env: + include_paths: | + charsets/ + docs/ + extra/ + layouts/ + masks/ + modules/ + OpenCL/ + rules/ + example* + hashcat* + on: push: branches: @@ -13,6 +26,7 @@ on: - 'src/**.c' - 'tools/**' - '**/Makefile' + - '.github/workflows/build.yml' pull_request: branches: - master @@ -23,6 +37,7 @@ on: - 'src/**.c' - 'tools/**' - '**/Makefile' + - '.github/workflows/build.yml' jobs: build: @@ -38,3 +53,8 @@ jobs: env: SHARED: ${{ matrix.shared }} run: make + - name: Generate artifacts (shared) + uses: actions/upload-artifact@v3 + with: + name: hashcat-${{ matrix.os }}-${{ matrix.shared }} + path: ${{ env.include_paths }} From 0355b9323806342d65ac263c7338cd56649cae83 Mon Sep 17 00:00:00 2001 From: Matt <5032824+mdawsonuk@users.noreply.github.com> Date: Thu, 14 Jul 2022 19:30:47 +0100 Subject: [PATCH 2/3] Add WSL build, fix missing .so, improved artifact naming --- .github/workflows/build.yml | 45 ++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13ac438c6..e169d289d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,7 @@ env: rules/ example* hashcat* + libhashcat* on: push: @@ -44,17 +45,51 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] # todo: windows-latest - lack of iconv development files + os: [ubuntu-latest, macos-latest, windows-latest] # todo: windows-latest - lack of iconv development files shared: [0, 1] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Build + - name: Checkout Hashcat + uses: actions/checkout@v3 + - name: Checkout win-iconv + uses: actions/checkout@v3 + if: ${{ matrix.os == 'windows-latest' }} + with: + repository: win-iconv/win-iconv + path: 'win-iconv/' + clean: false + - name: Install WSL + uses: Vampire/setup-wsl@v1 + if: ${{ matrix.os == 'windows-latest' }} + with: + additional-packages: + gcc-mingw-w64-x86-64 + g++-mingw-w64-x86-64 + make + git + patch + - name: Setup WSL + if: ${{ matrix.os == 'windows-latest' }} + shell: wsl-bash {0} + run: cd win-iconv/ && patch < ../tools/win-iconv-64.diff && sudo make install + - name: Build (Win) + if: ${{ matrix.os == 'windows-latest' }} + shell: wsl-bash {0} + run: make win + - name: Build (Unix) + if: ${{ matrix.os != 'windows-latest' }} env: SHARED: ${{ matrix.shared }} run: make - - name: Generate artifacts (shared) + - name: Generate static artifacts + if: ${{ matrix.shared == 0 }} + uses: actions/upload-artifact@v3 + with: + name: hashcat-${{ runner.os }}-static + path: ${{ env.include_paths }} + - name: Generate shared artifacts + if: ${{ matrix.shared == 1 }} uses: actions/upload-artifact@v3 with: - name: hashcat-${{ matrix.os }}-${{ matrix.shared }} + name: hashcat-${{ runner.os }}-shared path: ${{ env.include_paths }} From 53ed6c33e8e35dc89f837eefc756264e7130bde8 Mon Sep 17 00:00:00 2001 From: kgolawski Date: Fri, 15 Jul 2022 01:22:35 +0200 Subject: [PATCH 3/3] Update workflow to build on Windows runner --- .github/workflows/build.yml | 111 ++++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e169d289d..da7d0e8e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,17 +2,17 @@ name: Build env: include_paths: | - charsets/ - docs/ - extra/ - layouts/ - masks/ - modules/ - OpenCL/ - rules/ - example* - hashcat* - libhashcat* + charsets/ + docs/ + extra/ + layouts/ + masks/ + modules/ + OpenCL/ + rules/ + example* + hashcat* + libhashcat* on: push: @@ -41,55 +41,70 @@ on: - '.github/workflows/build.yml' jobs: - build: + build-linux: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] # todo: windows-latest - lack of iconv development files shared: [0, 1] - runs-on: ${{ matrix.os }} + name: Build Linux (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) + runs-on: ubuntu-latest steps: - - name: Checkout Hashcat - uses: actions/checkout@v3 - - name: Checkout win-iconv - uses: actions/checkout@v3 - if: ${{ matrix.os == 'windows-latest' }} - with: - repository: win-iconv/win-iconv - path: 'win-iconv/' - clean: false - - name: Install WSL - uses: Vampire/setup-wsl@v1 - if: ${{ matrix.os == 'windows-latest' }} + - uses: actions/checkout@v3 + - name: Build + env: + SHARED: ${{ matrix.shared }} + run: make + - name: Generate artifacts + uses: actions/upload-artifact@v3 with: - additional-packages: - gcc-mingw-w64-x86-64 - g++-mingw-w64-x86-64 - make - git - patch - - name: Setup WSL - if: ${{ matrix.os == 'windows-latest' }} - shell: wsl-bash {0} - run: cd win-iconv/ && patch < ../tools/win-iconv-64.diff && sudo make install - - name: Build (Win) - if: ${{ matrix.os == 'windows-latest' }} - shell: wsl-bash {0} - run: make win - - name: Build (Unix) - if: ${{ matrix.os != 'windows-latest' }} + name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} + path: ${{ env.include_paths }} + + build-macos: + strategy: + fail-fast: false + matrix: + shared: [0, 1] + name: Build MacOS (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Build env: SHARED: ${{ matrix.shared }} run: make - - name: Generate static artifacts - if: ${{ matrix.shared == 0 }} + - name: Generate artifacts uses: actions/upload-artifact@v3 with: - name: hashcat-${{ runner.os }}-static + name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} path: ${{ env.include_paths }} - - name: Generate shared artifacts - if: ${{ matrix.shared == 1 }} + + build-windows: + strategy: + fail-fast: false + matrix: + shared: [0, 1] + name: Build Windows (${{ matrix.shared == 0 && 'Static' || 'Shared' }}) + runs-on: windows-latest + steps: + - name: Install libiconv + uses: msys2/setup-msys2@v2 + with: + update: true + install: | + gcc + git + libiconv + libiconv-devel + make + - uses: actions/checkout@v3 + - name: Build + shell: msys2 {0} + env: + SHARED: ${{ matrix.shared }} + run: make + - name: Generate artifacts uses: actions/upload-artifact@v3 with: - name: hashcat-${{ runner.os }}-shared + name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }} path: ${{ env.include_paths }}