Merge pull request #97 from x64dbg/platform-improvements #353
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
defaults: | |
run: | |
shell: cmd | |
jobs: | |
build: | |
# Skip building pull requests from the same repository | |
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} | |
name: Windows | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dotnet-version: ['6.0.x'] | |
platform: | |
- {build: 'Win32', arch: 'x32'} | |
- {build: 'x64', arch: 'x64'} | |
env: | |
CONFIGURATION: Release | |
PLATFORM: ${{ matrix.platform.arch }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Build | |
run: | | |
cmake . -B build -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.platform.build }} | |
cmake --build build --config Release | |
- name: Tests | |
run: | | |
pushd . | |
cd bin\${{ matrix.platform.arch }}\tests | |
Dotx64DbgTests.exe | |
popd | |
- name: Upload artifacts (CI) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dotx64Dbg-${{ runner.os }}-${{ matrix.platform.arch }} | |
path: bin/ | |
if-no-files-found: error | |
package: | |
needs: build | |
name: Package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Display structure of downloaded files | |
shell: bash | |
run: ls -R | |
working-directory: artifacts | |
- name: Merge artifacts | |
shell: bash | |
run: | | |
mkdir -p package/x64/plugins/Dotx64Dbg | |
mkdir -p package/x32/plugins/Dotx64Dbg | |
mkdir package/dotplugins | |
mkdir package/dotscripts | |
rm -R ./artifacts/dotx64Dbg-Windows-x32/x32/tests | |
rm -R ./artifacts/dotx64Dbg-Windows-x64/x64/tests | |
cp -R -n ./artifacts/dotx64Dbg-Windows-x64/x64/* ./package/x64/plugins/Dotx64Dbg | |
cp -R -n ./artifacts/dotx64Dbg-Windows-x32/x32/* ./package/x32/plugins/Dotx64Dbg | |
cp -R -n ./artifacts/dotx64Dbg-Windows-x32/dotplugins/* ./package/dotplugins/ | |
cp -R -n ./artifacts/dotx64Dbg-Windows-x32/dotscripts/* ./package/dotscripts/ | |
cp -R -n ./artifacts/dotx64Dbg-Windows-x32/dotx64dbg.json ./package/dotx64dbg.json | |
find ./package -type f -name '*.pdb' -delete | |
find ./package -type f -name '*.lib' -delete | |
find ./package -type f -name '*.exp' -delete | |
find ./package -type f -name '*.ilk' -delete | |
- name: Upload package (CI) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dotx64dbg | |
path: package | |
if-no-files-found: error | |
- name: Compress package | |
uses: papeloto/action-zip@1379ea20d4c5705669ba81fd626dd01b1c738f26 # v1.2 | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
with: | |
files: package/ | |
dest: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip | |
- name: Release | |
uses: softprops/action-gh-release@d99959edae48b5ffffd7b00da66dcdb0a33a52ee # v2.0.2 | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
with: | |
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') || contains(github.ref, '-pre') }} | |
files: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |