diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31acaa6..d968f68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ on: jobs: - build-linux: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -21,53 +21,41 @@ jobs: with: go-version: '1.22' - - name: Build - run: go build -v -ldflags "-s -w" -o hasherino-linux + - name Install dependencies + run: | + sudo apt-get update + sudo apt-get gcc libgl1-mesa-dev xorg-dev gcc-mingw-w64 - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: hasherino-linux - path: hasherino-linux - - build-windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.22' + - name: Linux build + run: go build -v -ldflags "-s -w" -o hasherino-linux - - name: Build - run: go build -v -ldflags "-s -w" -o hasherino-windows.exe + - name: Windows build + run: | + export GOOS=windows + export GOARCH=amd64 + export CGO_ENABLED=1 + export CC=x86_64-w64-mingw32-gcc + go build -v -ldflags "-s -w" -o hasherino-windows.exe - - name: Upload artifact + - name: Upload artifacts uses: actions/upload-artifact@v3 with: - name: hasherino-windows - path: hasherino-windows.exe - + name: hasherino + path: | + hasherino-linux + hasherino-windows.exe + release: runs-on: ubuntu-latest - needs: [build-linux, build-windows] + needs: build steps: - uses: actions/checkout@v3 - - name: Download windows artifact - id: linux - uses: actions/download-artifact@v3 - with: - name: 'hasherino-windows' - path: 'artifacts' - - - name: Download linux artifact - id: windows + - name: Download artifacts uses: actions/download-artifact@v3 with: - name: 'hasherino-linux' + name: 'hasherino' path: 'artifacts' - name: Release