build.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. on:
  2. pull_request:
  3. push:
  4. workflow_dispatch:
  5. jobs:
  6. build_ubuntu:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: gitconfig
  10. run: |
  11. git config --global core.autocrlf input
  12. # git config --global core.eol lf
  13. - name: checkout
  14. uses: actions/checkout@v4
  15. - name: Install Rust
  16. uses: dtolnay/rust-toolchain@stable
  17. with:
  18. toolchain: stable
  19. targets: x86_64-unknown-linux-gnu
  20. components: rustfmt, clippy
  21. - name: Set up cargo cache
  22. uses: Swatinem/rust-cache@v2
  23. continue-on-error: false
  24. with:
  25. key: ${{ runner.os }}-cargo-${{ hashFiles('rustybits//Cargo.lock') }}
  26. shared-key: ${{ runner.os }}-cargo-
  27. workspaces: |
  28. rustybits/
  29. - name: make
  30. run: make
  31. - name: selftest
  32. run: |
  33. make selftest
  34. ./zerotier-selftest
  35. - name: 'Tar files' # keeps permissions (execute)
  36. run: tar -cvf zerotier-one.tar zerotier-one
  37. - name: Archive production artifacts
  38. uses: actions/upload-artifact@v4
  39. with:
  40. name: zerotier-one-ubuntu-x64
  41. path: zerotier-one.tar
  42. retention-days: 7
  43. build_macos:
  44. runs-on: macos-latest
  45. steps:
  46. - name: gitconfig
  47. run: |
  48. git config --global core.autocrlf input
  49. # git config --global core.eol lf
  50. - name: checkout
  51. uses: actions/checkout@v4
  52. - name: Install Rust aarch64
  53. uses: dtolnay/rust-toolchain@stable
  54. with:
  55. toolchain: stable
  56. target: aarch64-apple-darwin
  57. components: rustfmt, clippy
  58. - name: Install Rust x86_64
  59. uses: dtolnay/rust-toolchain@stable
  60. with:
  61. toolchain: stable
  62. target: x86_64-apple-darwin
  63. components: rustfmt, clippy
  64. - name: Set up cargo cache
  65. uses: Swatinem/rust-cache@v2
  66. continue-on-error: false
  67. with:
  68. key: ${{ runner.os }}-cargo-${{ hashFiles('rustybits//Cargo.lock') }}
  69. shared-key: ${{ runner.os }}-cargo-
  70. workspaces: |
  71. rustybits/
  72. - name: make
  73. run: make
  74. - name: selftest
  75. run: |
  76. make selftest
  77. ./zerotier-selftest
  78. - name: 'Tar files' # keeps permissions (execute)
  79. run: tar -cvf zerotier-one.tar zerotier-one
  80. - name: Archive production artifacts
  81. uses: actions/upload-artifact@v4
  82. with:
  83. name: zerotier-one-mac
  84. path: zerotier-one.tar
  85. retention-days: 7
  86. build_windows:
  87. runs-on: windows-latest
  88. steps:
  89. - name: gitconfig
  90. run: |
  91. git config --global core.autocrlf true
  92. # git config --global core.eol lf
  93. - name: checkout
  94. uses: actions/checkout@v4
  95. - name: Install Rust
  96. uses: dtolnay/rust-toolchain@stable
  97. with:
  98. toolchain: stable
  99. target: aarch64-apple-darwin
  100. components: rustfmt, clippy
  101. - name: Set up cargo cache
  102. uses: Swatinem/rust-cache@v2
  103. continue-on-error: false
  104. with:
  105. key: ${{ runner.os }}-cargo-${{ hashFiles('rustybits//Cargo.lock') }}
  106. shared-key: ${{ runner.os }}-cargo-
  107. workspaces: |
  108. rustybits/
  109. - name: setup msbuild
  110. uses: microsoft/setup-msbuild@v2
  111. - name: msbuild
  112. run: |
  113. msbuild windows\ZeroTierOne.sln /m /p:Configuration=Release /property:Platform=x64 /t:ZeroTierOne
  114. - name: Archive production artifacts
  115. uses: actions/upload-artifact@v4
  116. with:
  117. name: zerotier-one-windows
  118. path: windows/Build
  119. retention-days: 7