Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Jul 5, 2024
0 parents commit fc3028f
Show file tree
Hide file tree
Showing 251 changed files with 23,890 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk/bindgen/** linguist-vendored
47 changes: 47 additions & 0 deletions .github/workflows/bin.yml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Download Release Asset on Windows

on:
push:
branches:
- main

jobs:
download-artifact:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up PowerShell
shell: pwsh
run: |
# 获取发布的资产信息
$token = "${{ secrets.GITHUB_TOKEN }}"
$headers = @{
Authorization = "token $token"
}
$owner = "owner" # 仓库拥有者
$repo = "repo" # 仓库名称
$tag = "v1.0.0" # 你要下载的发布版本标签

$releasesUrl = "https://api.github.com/repos/$owner/$repo/releases"
$releases = Invoke-RestMethod -Uri $releasesUrl -Headers $headers
$release = $releases | Where-Object { $_.tag_name -eq $tag }

if (-not $release) {
throw "Release not found"
}

$asset = $release.assets | Where-Object { $_.name -eq "your_asset_name.zip" } # 你要下载的资产名称

if (-not $asset) {
throw "Asset not found"
}

# 下载资产
$assetUrl = $asset.browser_download_url
Invoke-RestMethod -Uri $assetUrl -Headers $headers -OutFile "downloaded_asset.zip"

- name: Unzip the asset
run: Expand-Archive -Path downloaded_asset.zip -DestinationPath ./unzipped
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Test on Windows

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Download latest HyperDbg release
run: |
curl -s https://api.github.com/repos/HyperDbg/HyperDbg/releases/latest `
| jq -r '.assets[] | select(.name | test("\\.zip$")) | .browser_download_url' `
| % { Invoke-WebRequest $_ -OutFile 'hyperdbg.zip' }
- name: Unzip HyperDbg
run: |
Expand-Archive -Path hyperdbg.zip -DestinationPath hyperdbg
- name: List contents of HyperDbg
run: |
Get-ChildItem -Path hyperdbg -Recurse
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22.4'

- name: Install dependencies
run: go mod tidy

- name: Copy SDK directory to target path
run: |
xcopy hyperdbg\SDK\* .\gui\sdk\bindgen\SDK\ /E /H /Y
- name: Build the project
run: go build ./...

- name: Run tests
run: go test ./...
97 changes: 97 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Pre-release HyperDbg and GUI

on:
push:
branches:
- main
tags:
- v*.**
- weekly.**
- 0.**

env:
RELEASE_ZIP_FILE_NAME: hyperdbgui

jobs:
test-on-multiple-os:
name: Test on multiple OS
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.4'

- name: Install GCC on Windows
run: choco install mingw

- name: Install dependencies
run: go mod tidy

- name: Run tests
run: go test ./...

- name: Build project
run: go build .

- name: Debug - Check GITHUB_REF
run: |
echo "GITHUB_REF is: ${{ github.ref }}"
echo "GITHUB_EVENT_REF is: ${{ github.event.ref }}"
package-and-release:
needs: test-on-multiple-os
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/v')

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.4'

- name: Install GCC on Windows
run: choco install mingw

- name: Install dependencies
run: go mod tidy

- name: Build project
run: go build .

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.0'

- name: Install GitHub Changelog Generator
run: gem install github_changelog_generator

- name: Generate Changelog
run: github_changelog_generator --user ${{ github.repository_owner }} --project ${{ github.event.repository.name }} --token ${{ secrets.GITHUB_TOKEN }}

- name: Create source code archive
run: powershell -Command "Get-ChildItem -Recurse | Where-Object { $_.FullName -notmatch '\.git' -and $_.Extension -notmatch '\.dll|\.sys|\.exe' } | Compress-Archive -DestinationPath ${env:RELEASE_ZIP_FILE_NAME}-${{ github.ref_name }}.zip -CompressionLevel Optimal"

- name: Create binaries archive
run: powershell -Command "Get-ChildItem -Recurse -Include 'hyperdbgui.exe' | Compress-Archive -DestinationPath binaries-${{ github.ref_name }}.zip"

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.RELEASE_ZIP_FILE_NAME }}-${{ github.ref_name }}.zip
binaries-${{ github.ref_name }}.zip
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.tk }}
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.idea
*.json
*.txt
*.pdb
*.exp
*.lib
*.log
reset git.cmd
cmake-build-debug
bin
/hyperdbgui.exe
/binaries-bin.zip
Loading

0 comments on commit fc3028f

Please sign in to comment.