Skip to content

Commit

Permalink
Merge pull request #9 from Wraient/Github-actions-cicd
Browse files Browse the repository at this point in the history
Github Actions CI/CD Implementation test
  • Loading branch information
Wraient authored Oct 26, 2024
2 parents b60311d + 3cdc70f commit c3fa51f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,15 @@ jobs:
- name: Build Linux binary
run: |
pwd
tree ./
outputDir="Build"
mkdir -p "$outputDir"
go build -o "$outputDir/curd" ./cmd/curd/main.go
pwd
tree ./
./Build/buildlinux
- name: Revert Changes in player.go
run: |
git checkout -- internal/player.go
- name: Build Windows binary (cross-compile)
run: |
pwd
tree ./
outputDir="Build"
mkdir -p "$outputDir"
GOOS=windows GOARCH=amd64 go build -o "$outputDir/curd.exe" ./cmd/curd/main.go
pwd
tree ./
./Build/buildwindows
- name: Upload Artifacts
uses: actions/upload-artifact@v4 # Updated to version 4
Expand Down Expand Up @@ -131,6 +119,6 @@ jobs:
files: |
Build/curd
Build/curd.exe
Build/curdInstaller.exe
Build/Output/CurdInstaller.exe
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_PAT }}
6 changes: 4 additions & 2 deletions Build/buildlinux
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o curd -ldflags="-s -w" -trimpath cmd/curd/main.go
upx --best --ultra-brute curd
outputDir="Build"
mkdir -p "$outputDir"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "$outputDir/curd" -ldflags="-s -w" -trimpath cmd/curd/main.go
upx --best --ultra-brute "$outputDir/curd"
17 changes: 3 additions & 14 deletions Build/buildwindows
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
@echo off
echo Starting the build process...
set GOOS=windows
set GOARCH=amd64
echo GOOS is set to %GOOS%
echo GOARCH is set to %GOARCH%
echo Building Go application...
tree /F
go build -o curd.exe .\cmd\curd\main.go
if %ERRORLEVEL% NEQ 0 (
echo Build failed with error level %ERRORLEVEL%
) else (
echo Build completed successfully!
)
outputDir="Build"
mkdir -p "$outputDir"
GOOS=windows GOARCH=amd64 go build -o "$outputDir/curd.exe" -ldflags "-s -w" ./cmd/curd/main.go

0 comments on commit c3fa51f

Please sign in to comment.