Update workflow to build on Windows runner

pull/3301/head
kgolawski 2 years ago committed by GitHub
parent 0355b93238
commit 53ed6c33e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,17 +2,17 @@ name: Build
env: env:
include_paths: | include_paths: |
charsets/ charsets/
docs/ docs/
extra/ extra/
layouts/ layouts/
masks/ masks/
modules/ modules/
OpenCL/ OpenCL/
rules/ rules/
example* example*
hashcat* hashcat*
libhashcat* libhashcat*
on: on:
push: push:
@ -41,55 +41,70 @@ on:
- '.github/workflows/build.yml' - '.github/workflows/build.yml'
jobs: jobs:
build: build-linux:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] # todo: windows-latest - lack of iconv development files
shared: [0, 1] shared: [0, 1]
runs-on: ${{ matrix.os }} name: Build Linux (${{ matrix.shared == 0 && 'Static' || 'Shared' }})
runs-on: ubuntu-latest
steps: steps:
- name: Checkout Hashcat - uses: actions/checkout@v3
uses: actions/checkout@v3 - name: Build
- name: Checkout win-iconv env:
uses: actions/checkout@v3 SHARED: ${{ matrix.shared }}
if: ${{ matrix.os == 'windows-latest' }} run: make
with: - name: Generate artifacts
repository: win-iconv/win-iconv uses: actions/upload-artifact@v3
path: 'win-iconv/'
clean: false
- name: Install WSL
uses: Vampire/setup-wsl@v1
if: ${{ matrix.os == 'windows-latest' }}
with: with:
additional-packages: name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }}
gcc-mingw-w64-x86-64 path: ${{ env.include_paths }}
g++-mingw-w64-x86-64
make build-macos:
git strategy:
patch fail-fast: false
- name: Setup WSL matrix:
if: ${{ matrix.os == 'windows-latest' }} shared: [0, 1]
shell: wsl-bash {0} name: Build MacOS (${{ matrix.shared == 0 && 'Static' || 'Shared' }})
run: cd win-iconv/ && patch < ../tools/win-iconv-64.diff && sudo make install runs-on: macos-latest
- name: Build (Win) steps:
if: ${{ matrix.os == 'windows-latest' }} - uses: actions/checkout@v3
shell: wsl-bash {0} - name: Build
run: make win
- name: Build (Unix)
if: ${{ matrix.os != 'windows-latest' }}
env: env:
SHARED: ${{ matrix.shared }} SHARED: ${{ matrix.shared }}
run: make run: make
- name: Generate static artifacts - name: Generate artifacts
if: ${{ matrix.shared == 0 }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: hashcat-${{ runner.os }}-static name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }}
path: ${{ env.include_paths }} 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 uses: actions/upload-artifact@v3
with: with:
name: hashcat-${{ runner.os }}-shared name: Hashcat-${{ runner.os }}-${{ matrix.shared == 0 && 'Static' || 'Shared' }}
path: ${{ env.include_paths }} path: ${{ env.include_paths }}

Loading…
Cancel
Save