ci.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. name: ci
  2. on: [push, pull_request]
  3. permissions:
  4. contents: read
  5. jobs:
  6. build:
  7. strategy:
  8. fail-fast: false
  9. matrix:
  10. # https://docs.github.com/en/actions/using-github-hosted-runners
  11. os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
  12. runs-on: ${{ matrix.os }}
  13. steps:
  14. - uses: actions/checkout@v4
  15. - uses: actions/setup-go@v5
  16. with:
  17. go-version: stable
  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