Skip to content

Commit 4494aed

Browse files
committed
fix: use PowerShell for Windows build and update macOS runner
- Switch Windows build from msys2 shell to PowerShell with MinGW in PATH - Update macos-13 (deprecated) to macos-15 for Intel builds
1 parent 7eb5427 commit 4494aed

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
# macOS builds (native on macos)
106106
- os: darwin
107107
arch: amd64
108-
runner: macos-13
108+
runner: macos-15
109109
ext: ''
110110
cc: clang
111111
- os: darwin
@@ -139,7 +139,7 @@ jobs:
139139
with:
140140
msystem: MINGW64
141141
update: true
142-
install: mingw-w64-x86_64-gcc
142+
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config
143143

144144
- name: Get version from tag
145145
id: version
@@ -171,27 +171,26 @@ jobs:
171171
172172
- name: Build binary (Windows)
173173
if: matrix.os == 'windows'
174-
shell: msys2 {0}
174+
shell: pwsh
175175
env:
176-
GOOS: windows
177-
GOARCH: ${{ matrix.arch }}
178176
CGO_ENABLED: 1
179177
run: |
180-
export PATH="/mingw64/bin:$PATH"
181-
VERSION=${{ steps.version.outputs.VERSION }}
182-
BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
183-
COMMIT=$(git rev-parse --short HEAD)
178+
$env:PATH = "C:\msys64\mingw64\bin;$env:PATH"
179+
$VERSION = "${{ steps.version.outputs.VERSION }}"
180+
$BUILD_TIME = (Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ")
181+
$COMMIT = git rev-parse --short HEAD
184182
185-
LDFLAGS="-s -w"
186-
LDFLAGS="${LDFLAGS} -X github.com/alvarorichard/Goanime/internal/version.Version=${VERSION}"
187-
LDFLAGS="${LDFLAGS} -X github.com/alvarorichard/Goanime/internal/version.BuildTime=${BUILD_TIME}"
188-
LDFLAGS="${LDFLAGS} -X github.com/alvarorichard/Goanime/internal/version.Commit=${COMMIT}"
183+
$LDFLAGS = "-s -w"
184+
$LDFLAGS = "$LDFLAGS -X github.com/alvarorichard/Goanime/internal/version.Version=$VERSION"
185+
$LDFLAGS = "$LDFLAGS -X github.com/alvarorichard/Goanime/internal/version.BuildTime=$BUILD_TIME"
186+
$LDFLAGS = "$LDFLAGS -X github.com/alvarorichard/Goanime/internal/version.Commit=$COMMIT"
189187
190-
OUTPUT_NAME="${{ env.BINARY_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}"
188+
$OUTPUT_NAME = "${{ env.BINARY_NAME }}-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.ext }}"
191189
192-
go build -ldflags "${LDFLAGS}" -o "dist/${OUTPUT_NAME}" ./cmd/goanime
190+
New-Item -ItemType Directory -Force -Path dist | Out-Null
191+
go build -ldflags "$LDFLAGS" -o "dist/$OUTPUT_NAME" ./cmd/goanime
193192
194-
echo "Built ${OUTPUT_NAME} with SQLite support"
193+
Write-Host "Built $OUTPUT_NAME with SQLite support"
195194
196195
- name: Upload artifact
197196
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)