ci.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
  10. runs-on: ${{ matrix.os }}
  11. steps:
  12. - uses: actions/checkout@v5
  13. - uses: actions/setup-go@v6
  14. with:
  15. go-version: stable
  16. - name: Install libx11-dev for clipboard support
  17. if: runner.os == 'Linux'
  18. run: sudo apt install libx11-dev
  19. - name: Build
  20. run: go build -trimpath -ldflags=-s .
  21. - uses: actions/upload-artifact@v4
  22. if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
  23. with:
  24. name: discordo_${{ runner.os }}_${{ runner.arch }}
  25. path: |
  26. discordo
  27. discordo.exe
  28. - name: Send repository dispatch
  29. if: ${{ runner.os == 'Windows' && github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
  30. env:
  31. GH_TOKEN: ${{ secrets.PAT }}
  32. run: |
  33. gh api --method POST -H "Accept: application/vnd.github+json" -f "event_type=discordo-ci-completed" /repos/vvirtues/bucket/dispatches