ci.yml 1.2 KB

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