release.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. on:
  2. push:
  3. tags:
  4. - 'v*'
  5. name: Build Release Binaries
  6. jobs:
  7. linux-x86-64:
  8. name: Linux x86-64
  9. runs-on: solang-ubuntu-latest
  10. container: ghcr.io/hyperledger/solang-llvm:ci-7
  11. steps:
  12. - name: Checkout sources
  13. uses: actions/checkout@v4
  14. with:
  15. submodules: recursive
  16. - uses: dtolnay/rust-toolchain@1.74.0
  17. - name: Build
  18. run: cargo build --verbose --release
  19. - name: Run tests
  20. run: cargo test --workspace --verbose --release
  21. - name: Upload binary
  22. uses: svenstaro/upload-release-action@v2
  23. with:
  24. repo_token: ${{ secrets.GITHUB_TOKEN }}
  25. file: target/release/solang
  26. asset_name: solang-linux-x86-64
  27. tag: ${{ github.ref }}
  28. linux-arm64:
  29. name: Linux arm64
  30. runs-on: solang-arm
  31. if: ${{ github.repository_owner == 'hyperledger-solang' }}
  32. steps:
  33. - name: Checkout sources
  34. uses: actions/checkout@v4
  35. with:
  36. submodules: recursive
  37. - name: Basic build tools
  38. run: |
  39. sudo apt-get update
  40. sudo apt-get install -y gcc g++ make
  41. - uses: dtolnay/rust-toolchain@1.74.0
  42. - name: Get LLVM
  43. run: curl -sSL --output llvm16.0-linux-arm64.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-linux-arm64.tar.xz
  44. - name: Extract LLVM
  45. run: tar Jxf llvm16.0-linux-arm64.tar.xz
  46. - name: Add LLVM to Path
  47. run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
  48. - name: Build
  49. run: cargo build --verbose --release
  50. - name: Run tests
  51. run: cargo test --workspace --verbose --release
  52. - name: Upload binary
  53. uses: svenstaro/upload-release-action@v2
  54. with:
  55. repo_token: ${{ secrets.GITHUB_TOKEN }}
  56. file: target/release/solang
  57. asset_name: solang-linux-arm64
  58. tag: ${{ github.ref }}
  59. windows:
  60. name: Windows
  61. runs-on: windows-latest
  62. steps:
  63. - name: Checkout sources
  64. uses: actions/checkout@v4
  65. with:
  66. submodules: recursive
  67. - name: Download LLVM
  68. run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-win.zip
  69. - name: Extract LLVM
  70. run: unzip c:\llvm.zip -d c:/
  71. - name: Add LLVM to Path
  72. run: echo "c:\llvm16.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
  73. - uses: dtolnay/rust-toolchain@1.74.0
  74. with:
  75. components: clippy
  76. - name: Build
  77. run: cargo build --release --verbose
  78. - name: Run tests
  79. run: cargo test --workspace --release --verbose
  80. - name: Upload binary
  81. uses: svenstaro/upload-release-action@v2
  82. with:
  83. repo_token: ${{ secrets.GITHUB_TOKEN }}
  84. file: target/release/solang.exe
  85. asset_name: solang.exe
  86. tag: ${{ github.ref }}
  87. mac-arm:
  88. name: Mac Arm
  89. runs-on: macos-13-xlarge
  90. steps:
  91. - name: Checkout sources
  92. uses: actions/checkout@v4
  93. with:
  94. submodules: recursive
  95. - uses: dtolnay/rust-toolchain@1.74.0
  96. - name: Get LLVM
  97. run: curl -sSL --output llvm16.0-mac-arm.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-arm.tar.xz
  98. - name: Extract LLVM
  99. run: tar Jxf llvm16.0-mac-arm.tar.xz
  100. - name: Add LLVM to Path
  101. run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
  102. - name: Build
  103. run: cargo build --release --verbose
  104. - name: Run tests
  105. run: cargo test --workspace --release --verbose
  106. - name: Upload binary
  107. uses: svenstaro/upload-release-action@v2
  108. with:
  109. repo_token: ${{ secrets.GITHUB_TOKEN }}
  110. file: target/release/solang
  111. asset_name: solang-mac-arm
  112. tag: ${{ github.ref }}
  113. mac-intel:
  114. name: Mac Intel
  115. runs-on: macos-12
  116. steps:
  117. - name: Checkout sources
  118. uses: actions/checkout@v4
  119. with:
  120. submodules: recursive
  121. - uses: dtolnay/rust-toolchain@1.74.0
  122. - name: Get LLVM
  123. run: wget -q -O llvm16.0-mac-intel.tar.xz https://github.com/hyperledger-solang/solang-llvm/releases/download/llvm16-0/llvm16.0-mac-intel.tar.xz
  124. - name: Extract LLVM
  125. run: tar Jxf llvm16.0-mac-intel.tar.xz
  126. - name: Add LLVM to Path
  127. run: echo "$(pwd)/llvm16.0/bin" >> $GITHUB_PATH
  128. - name: Build
  129. run: cargo build --release --verbose
  130. - name: Run tests
  131. run: cargo test --workspace --release --verbose
  132. - name: Upload binary
  133. uses: svenstaro/upload-release-action@v2
  134. with:
  135. repo_token: ${{ secrets.GITHUB_TOKEN }}
  136. file: target/release/solang
  137. asset_name: solang-mac-intel
  138. tag: ${{ github.ref }}
  139. mac-universal:
  140. name: Mac Universal Binary
  141. runs-on: macos-latest
  142. needs: [mac-arm, mac-intel]
  143. steps:
  144. - run: |
  145. curl -sSL --output solang-mac-intel https://github.com/hyperledger-solang/solang/releases/download/${GITHUB_REF/refs\/tags\//}/solang-mac-intel
  146. curl -sSL --output solang-mac-arm https://github.com/hyperledger-solang/solang/releases/download/${GITHUB_REF/refs\/tags\//}/solang-mac-arm
  147. lipo -create -output solang-mac solang-mac-intel solang-mac-arm
  148. - name: Upload binary
  149. uses: svenstaro/upload-release-action@v2
  150. with:
  151. repo_token: ${{ secrets.GITHUB_TOKEN }}
  152. file: solang-mac
  153. asset_name: solang-mac
  154. tag: ${{ github.ref }}
  155. container:
  156. name: Container Image
  157. runs-on: solang-ubuntu-latest
  158. steps:
  159. - name: Checkout sources
  160. uses: actions/checkout@v4
  161. - run: |
  162. echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
  163. docker buildx build . \
  164. --push \
  165. --tag ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_REF/refs\/tags\//} \
  166. --label org.opencontainers.image.description="Solidity Compiler for Solana and Polkadot version $(git describe --tags)"