forked from HyperDbg/gui
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (73 loc) · 2.54 KB
/
pre-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Pre-release HyperDbg and GUI
on:
push:
branches:
- main
tags:
- 'v*'
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/')
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 '*.dll', '*.sys', '*.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 }}