build.yml 3.4 KB

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