Merge pull request #13 from vpoluyaktov/feature_model_update #50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build GitHub Developer Profiler | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| VERSION: '' | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| ext: "" | |
| - os: macos-latest | |
| goos: darwin | |
| goarch: amd64 | |
| ext: "" | |
| - os: windows-latest | |
| goos: windows | |
| goarch: amd64 | |
| ext: ".exe" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y \ | |
| libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxxf86vm-dev \ | |
| libgl1-mesa-dev libglu1-mesa-dev build-essential | |
| - name: Install macOS dependencies | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| # Install required system libraries for Fyne on macOS | |
| brew install pkg-config | |
| - name: Ensure CGO is enabled | |
| run: echo "CGO_ENABLED=1" >> $GITHUB_ENV | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Extract version | |
| id: extract_version | |
| run: echo "VERSION=$(git describe --tags --always --dirty)" >> $GITHUB_ENV | |
| - name: Build for ${{ matrix.goos }} | |
| shell: bash | |
| run: | | |
| echo "VERSION is $VERSION" | |
| BUILD_DATE=$(date -u '+%Y-%m-%d_%H:%M:%S_UTC') | |
| GIT_COMMIT=$(git rev-parse --short HEAD) | |
| OUTFILE=GitHub_Developer_Profiler-${{ matrix.goos }}-${VERSION}-${{ matrix.goarch }}${{ matrix.ext }} | |
| echo "OUTFILE is $OUTFILE" | |
| go build -ldflags="-s -w -X main.version=$VERSION -X main.buildDate=$BUILD_DATE -X main.gitCommit=$GIT_COMMIT" -o $OUTFILE . | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| VERSION: ${{ env.VERSION }} | |
| - name: Test | |
| run: go test -v ./... | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: GitHub_Developer_Profiler-${{ matrix.goos }}-${{ env.VERSION }}-${{ matrix.goarch }}${{ matrix.ext }} |