-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
132 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ on: | |
permissions: | ||
contents: write | ||
# packages: write | ||
# issues: write | ||
# issues: write | ||
|
||
jobs: | ||
goreleaser: | ||
|
@@ -22,24 +22,40 @@ jobs: | |
|
||
- name: git fetch | ||
run: git fetch --force --tags | ||
|
||
- name: setup go | ||
- uses: actions/setup-go@v4 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: stable | ||
|
||
- name: set version in main.go | ||
run: sed -i "s/rest.StartServer(c.Port, \"1.0.0\")/rest.StartServer(c.Port, \"$(git tag | sort -Vr | head -n 1)\")/g" $PWD/main.go | ||
|
||
- name: build | ||
- uses: goreleaser/goreleaser-action@v4 | ||
- name: build go | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro': | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
args: release --clean --skip-publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' | ||
# distribution: | ||
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | ||
|
||
- name: innosetup | ||
run: | | ||
cp ./dist/hyper-v-rest-wmi_windows_amd64_v1/hyper-v-rest-wmi.exe packaging/hyper-v-rest-wmi.exe | ||
cd packaging/ | ||
docker build . --security-opt label=disable -t inno:64bit | ||
bash ./iscc.sh 64 innosetup.iss | ||
mv hyper-v-rest-wmi.exe hyper-v-rest-wmi-portable.exe | ||
- name: upload release | ||
id: create_release | ||
uses: marvinpinto/[email protected] | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
title: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
files: | | ||
./packaging/hyper-v-rest-wmi-portable.exe | ||
./packaging/Output/hyper-v-rest-wmi-setup.exe |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM docker.io/amake/innosetup:64bit | ||
USER root | ||
ENV HOME /home/xclient | ||
ENV WINEPREFIX /home/xclient/.wine | ||
#ENV WINEARCH win32 | ||
RUN chown -R root /home | ||
WORKDIR /work | ||
ENTRYPOINT ["iscc"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@ECHO OFF | ||
setlocal enabledelayedexpansion | ||
set "ServiceNames[0]=wmi-rest" | ||
set "ServiceNames[1]=hyper-v-rest-wmi" | ||
set "ServiceNames[2]=hyper-v-rest-ps" | ||
|
||
for /l %%i in (0, 1, 2) do ( | ||
set "ServiceName=!ServiceNames[%%i]!" | ||
sc query !ServiceName! | find "STATE" | find "RUNNING" >nul | ||
if !errorLevel! equ 0 ( | ||
sc stop !ServiceName! | ||
) | ||
sc delete !ServiceName! | ||
) | ||
|
||
endlocal |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[Setup] | ||
AppName=HyperV REST WMI | ||
AppVersion=2.1 | ||
AppPublisher=Mono Bilisim | ||
AppPublisherURL=https://mono.net.tr | ||
AppSupportURL=https://github.com/monobilisim/hyper-v-rest-wmi | ||
AppUpdatesURL=https://github.com/monobilisim/hyper-v-rest-wmi | ||
DefaultDirName={code:GetProgramFiles}\hyper-v-rest-wmi | ||
UsePreviousAppDir=false | ||
UninstallDisplayIcon={app}\hyper-v-rest-wmi.exe | ||
OutputBaseFilename=hyper-v-rest-wmi-setup | ||
Compression=lzma | ||
SolidCompression=yes | ||
|
||
[Code] | ||
function GetProgramFiles(Param: string): string; | ||
begin | ||
if IsWin64 then Result := ExpandConstant('{commonpf64}') | ||
else Result := ExpandConstant('{commonpf32}') | ||
end; | ||
procedure TaskKill(FileName: String); | ||
var | ||
ResultCode: Integer; | ||
begin | ||
Exec('taskkill.exe', '/f /im ' + '"' + FileName + '"', '', SW_HIDE, | ||
ewWaitUntilTerminated, ResultCode); | ||
end; | ||
[Files] | ||
Source: "hyper-v-rest-wmi.exe"; DestDir: "{app}"; BeforeInstall: TaskKill('hyper-v-rest-wmi.exe') | ||
Source: "cleanup.bat"; DestDir: "{app}" | ||
|
||
|
||
[Icons] | ||
;Name: "{group}\HyperV REST WMI"; Filename: "{app}\hyper-v-rest-wmi.exe" | ||
;Name: "{group}\Uninstall"; Filename: "{uninstallexe}" | ||
|
||
|
||
[Messages] | ||
SetupAppTitle=HyperV REST WMI | ||
|
||
|
||
[Run] | ||
Filename: "{app}\cleanup.bat" | ||
Filename: "{app}\hyper-v-rest-wmi.exe"; Description: "Install Service"; Parameters: --service=install | ||
Filename: "{app}\hyper-v-rest-wmi.exe"; Description: "Start Service" ; Parameters: --service=start | ||
|
||
|
||
[UninstallRun] | ||
Filename: "{app}\cleanup.bat" | ||
Filename: "{app}\hyper-v-rest-wmi.exe"; Parameters: --service=stop | ||
Filename: "{app}\hyper-v-rest-wmi.exe"; Parameters: --service=uninstall | ||
Filename: "{cmd}"; Parameters: "/C ""taskkill /im hyper-v-rest-wmi.exe /f /t" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
relpaths() { | ||
for arg in "$@"; do printf -- "%s\n" "${arg#$PWD/}"; done | ||
} | ||
|
||
bindpaths() { | ||
for arg in $(relpaths "$@"); do | ||
if [ -e "$arg" ] && [[ "$arg" == /* ]]; then | ||
printf -- "-v %s:%s" "$arg" "$arg" | ||
fi | ||
done | ||
} | ||
|
||
case $1 in | ||
32) | ||
exec docker run --rm -i --security-opt label=disable -v "$PWD":/work $(bindpaths "$@") -e WINEDEBUG=-all inno:32bit $(relpaths "${@:2}") | ||
;; | ||
64) | ||
exec docker run --rm -i --security-opt label=disable -v "$PWD":/work $(bindpaths "$@") -e WINEDEBUG=-all inno:64bit $(relpaths "${@:2}") | ||
;; | ||
*) | ||
exit 1 | ||
;; | ||
esac | ||
|
||
chown -R $USER: $PWD/ |