From 53d134f66f001d17fc4c66c271dff11265eb5719 Mon Sep 17 00:00:00 2001 From: Wraient Date: Sat, 26 Oct 2024 23:57:51 +0530 Subject: [PATCH] Fix: Fixing forever --- .github/workflows/ci-cd.yml | 33 +++++++++++++++++++++++---------- Build/buildwindows | 5 ++++- Build/curd-windows-build.iss | 2 +- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index b60e310..dc226b0 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -53,11 +53,6 @@ jobs: # run: | # git checkout -- internal/player.go - - name: Build Windows binary - run: | - chmod +x Build/buildwindows - ./Build/buildwindows - # - name: Run Tests # run: go test ./... # Run tests for your Go code @@ -70,6 +65,20 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.23.2' + + - name: Install Dependencies + run: go mod tidy # Install Go dependencies + + - name: Build Windows binary # Run the build script to generate curd.exe + run: | + cd Build # Navigate to Build directory + chmod +x buildwindows + ./buildwindows + - name: Download Inno Setup # Clean up run: | Invoke-WebRequest -Uri "https://jrsoftware.org/download.php/is.exe" -OutFile "is.exe" # Download Inno Setup installer @@ -78,11 +87,6 @@ jobs: - name: List Build Directory run: dir - - - name: Create Windows Installer - run: | - & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" Build/curd-windows-build.iss # Adjust the path to your Inno Setup script - shell: pwsh # Use PowerShell shell - name: Bump Version id: bump_version @@ -100,6 +104,15 @@ jobs: git commit -m "Bump version to $new_version" git tag "v$new_version" + - name: Update Inno Setup Script with New Version + run: | + sed -i "s/AppVersion=.*/AppVersion=${{ steps.bump_version.outputs.new_version }}/" Build/curd-windows-build.iss + + - name: Create Windows Installer + run: | + & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "D:\a\curd\curd\Build\curd-windows-build.iss" + shell: pwsh + - name: Create Release id: create_release uses: softprops/action-gh-release@v1 diff --git a/Build/buildwindows b/Build/buildwindows index eba8af8..e731162 100755 --- a/Build/buildwindows +++ b/Build/buildwindows @@ -1 +1,4 @@ -GOOS=windows GOARCH=amd64 go build -o Build/curd/curd.exe -ldflags="-s -w" cmd/curd/main.go \ No newline at end of file +@echo off +set GOOS=windows +set GOARCH=amd64 +go build -o curd.exe -ldflags="-s -w" -trimpath cmd\curd\main.go \ No newline at end of file diff --git a/Build/curd-windows-build.iss b/Build/curd-windows-build.iss index 1c5cbe3..96df9da 100644 --- a/Build/curd-windows-build.iss +++ b/Build/curd-windows-build.iss @@ -15,7 +15,7 @@ Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription [Files] ; Copy the Curd executable to the install directory -Source: "Build/curd/curd.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "Build/curd.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "Build/mpv.exe"; DestDir: "{app}\bin"; Flags: ignoreversion [Icons]