name: Build on: push: branches: - main pull_request: branches: - main env: GIT_TERMINAL_PROMPT: 1 GOPRIVATE: git.liteyuki.icu GONOSUMDB: git.liteyuki.icu jobs: build: name: Build runs-on: ubuntu-latest strategy: matrix: goos: [ linux, windows, darwin ] goarch: [ amd64, arm64] steps: - name: Checkout code uses: actions/checkout@v3 - name: Setup Go uses: actions/setup-go@v3 with: go-version: 1.22 - name: Auth For Private Dependencies run: git config --global url."https://${{ secrets.GITEA_TOKEN }}@git.liteyuki.icu".insteadOf "https://git.liteyuki.icu" - name: Install dependencies run: go mod tidy - name: Compile env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} run: | OUTPUT_NAME=server-status-server if [ "${{ matrix.goos }}" == "windows" ]; then OUTPUT_NAME="${OUTPUT_NAME}.exe"; fi go build -o build/${GOOS}-${GOARCH}/${OUTPUT_NAME} main.go - name: Upload binaries uses: actions/upload-artifact@v3 with: name: server-status-server-${{ matrix.goos }}-${{ matrix.goarch }} path: build/${{ matrix.goos }}-${{ matrix.goarch }}/server-status-server* if-no-files-found: warn