ci.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: ci
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. strategy:
  6. fail-fast: false
  7. matrix:
  8. # https://docs.github.com/en/actions/using-github-hosted-runners
  9. os:
  10. [
  11. ubuntu-latest,
  12. ubuntu-24.04-arm,
  13. windows-latest,
  14. windows-11-arm,
  15. macos-latest,
  16. macos-15-intel,
  17. ]
  18. runs-on: ${{ matrix.os }}
  19. steps:
  20. - uses: actions/checkout@v6
  21. - uses: actions/setup-go@v6
  22. with:
  23. go-version: stable
  24. - name: Install libx11-dev for clipboard support
  25. if: runner.os == 'Linux'
  26. run: sudo apt install libx11-dev
  27. - name: Test
  28. run: go test -v ./...
  29. - name: Build
  30. run: go build -trimpath -ldflags=-s .
  31. - uses: actions/upload-artifact@v6
  32. if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
  33. with:
  34. name: discordo_${{ runner.os }}_${{ runner.arch }}
  35. path: |
  36. discordo
  37. discordo.exe
  38. - name: Send repository dispatch
  39. if: ${{ runner.os == 'Windows' && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
  40. env:
  41. GH_TOKEN: ${{ secrets.PAT }}
  42. run: |
  43. gh api --method POST -H "Accept: application/vnd.github+json" -f "event_type=discordo-ci-completed" /repos/vvirtues/bucket/dispatches