|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*.*.*" |
| 7 | + |
| 8 | +env: |
| 9 | + RUNNER: tools/run-tests.py |
| 10 | + BUILD_OPTIONS: -DESCARGOT_MODE=release -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja |
| 11 | + |
| 12 | +jobs: |
| 13 | + build-mac64: |
| 14 | + runs-on: macos-13 |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + submodules: true |
| 19 | + - name: Install Packages |
| 20 | + run: | |
| 21 | + brew update |
| 22 | + brew install ninja icu4c@75 |
| 23 | + - name: Build x64 |
| 24 | + run: | |
| 25 | + # check cpu |
| 26 | + sysctl -a | grep machdep.cpu |
| 27 | + # add icu path to pkg_config_path |
| 28 | + brew --prefix icu4c@75 |
| 29 | + export PKG_CONFIG_PATH="/usr/local/opt/icu4c@75/lib/pkgconfig:$PKG_CONFIG_PATH" |
| 30 | + cmake -H. -Bout/ $BUILD_OPTIONS |
| 31 | + ninja -Cout/ |
| 32 | + - name: Check |
| 33 | + run: | |
| 34 | + file out/escargot |
| 35 | + strip out/escargot |
| 36 | + $RUNNER --engine="$GITHUB_WORKSPACE/out/escargot" new-es |
| 37 | + mv out/escargot out/escargot-mac64 |
| 38 | + - name: Upload |
| 39 | + uses: actions/upload-artifact@v4 |
| 40 | + with: |
| 41 | + name: mac64-result |
| 42 | + path: out/escargot-mac64 |
| 43 | + |
| 44 | + build-mac64arm: |
| 45 | + runs-on: macos-latest |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v4 |
| 48 | + with: |
| 49 | + submodules: true |
| 50 | + - name: Install Packages |
| 51 | + run: | |
| 52 | + brew update |
| 53 | + brew install ninja icu4c@75 |
| 54 | + - name: Build arm64 |
| 55 | + run: | |
| 56 | + # check cpu |
| 57 | + sysctl -a | grep machdep.cpu |
| 58 | + # add icu path to pkg_config_path |
| 59 | + brew --prefix icu4c@75 |
| 60 | + export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c@75/lib/pkgconfig:$PKG_CONFIG_PATH" |
| 61 | + cmake -H. -Bout/ $BUILD_OPTIONS |
| 62 | + ninja -Cout/ |
| 63 | + - name: Check |
| 64 | + run: | |
| 65 | + file out/escargot |
| 66 | + strip out/escargot |
| 67 | + $RUNNER --engine="$GITHUB_WORKSPACE/out/escargot" new-es |
| 68 | + mv out/escargot out/escargot-mac64arm |
| 69 | + - name: Upload |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: mac64arm-result |
| 73 | + path: out/escargot-mac64arm |
| 74 | + |
| 75 | + build-windows: |
| 76 | + runs-on: windows-2022 |
| 77 | + strategy: |
| 78 | + matrix: |
| 79 | + arch: [x86, x64] |
| 80 | + steps: |
| 81 | + - name: Set git cllf config |
| 82 | + run: | |
| 83 | + git config --global core.autocrlf input |
| 84 | + git config --global core.eol lf |
| 85 | + - uses: actions/checkout@v4 |
| 86 | + with: |
| 87 | + submodules: true |
| 88 | + |
| 89 | + with: |
| 90 | + timezoneWindows: "Pacific Standard Time" |
| 91 | + - uses: lukka/get-cmake@latest |
| 92 | + - uses: GuillaumeFalourd/setup-windows10-sdk-action@v2 |
| 93 | + with: |
| 94 | + sdk-version: 20348 |
| 95 | + - uses: actions/setup-python@v5 |
| 96 | + with: |
| 97 | + python-version: '3.11' |
| 98 | + - name: Install msvc redist package |
| 99 | + run: | |
| 100 | + (new-object System.Net.WebClient).DownloadFile('https://github.com/abbodi1406/vcredist/releases/download/v0.73.0/VisualCppRedist_AIO_x86_x64.exe','VisualCppRedist_AIO_x86_x64.exe') |
| 101 | + .\VisualCppRedist_AIO_x86_x64.exe /y |
| 102 | + |
| 103 | + with: |
| 104 | + arch: ${{ matrix.arch }} |
| 105 | + sdk: "10.0.20348.0" |
| 106 | + - name: Build ${{ matrix.arch }} |
| 107 | + run: | |
| 108 | + CMake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION:STRING="10.0" -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -DESCARGOT_ARCH=${{ matrix.arch }} -Bout/ -DESCARGOT_OUTPUT=shell -DESCARGOT_LIBICU_SUPPORT=ON -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=release |
| 109 | + CMake --build out/ --config Release |
| 110 | + - name: Check |
| 111 | + run: | |
| 112 | + python tools\run-tests.py --engine=%cd%\out\escargot.exe new-es |
| 113 | + rename out\escargot.exe escargot-win-${{ matrix.arch }}.exe |
| 114 | + shell: cmd |
| 115 | + - name: Upload |
| 116 | + uses: actions/upload-artifact@v4 |
| 117 | + with: |
| 118 | + name: win-${{ matrix.arch }}-result |
| 119 | + path: out\escargot-win-${{ matrix.arch }}.exe |
| 120 | + |
| 121 | + build-linux: |
| 122 | + runs-on: ubuntu-22.04 |
| 123 | + steps: |
| 124 | + - uses: actions/checkout@v4 |
| 125 | + with: |
| 126 | + submodules: true |
| 127 | + - name: Install Packages |
| 128 | + run: | |
| 129 | + # for i386 ICU |
| 130 | + sudo dpkg --add-architecture i386 |
| 131 | + sudo apt-get update |
| 132 | + sudo apt-get install -y ninja-build libicu-dev gcc-multilib g++-multilib |
| 133 | + sudo apt-get install -y libicu-dev:i386 # install i386 ICU |
| 134 | + - name: Build x86/x64 |
| 135 | + run: | |
| 136 | + cmake -H. -Bout/x86 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86 -DESCARGOT_TEMPORAL=ON $BUILD_OPTIONS |
| 137 | + cmake -H. -Bout/x64 -DESCARGOT_TEMPORAL=ON $BUILD_OPTIONS |
| 138 | + ninja -Cout/x86 |
| 139 | + ninja -Cout/x64 |
| 140 | + - name: Check |
| 141 | + run: | |
| 142 | + file out/x86/escargot |
| 143 | + file out/x64/escargot |
| 144 | + strip out/x86/escargot |
| 145 | + strip out/x64/escargot |
| 146 | + # set locale |
| 147 | + sudo locale-gen en_US.UTF-8 |
| 148 | + export LANG=en_US.UTF-8 |
| 149 | + locale |
| 150 | + # run test |
| 151 | + $RUNNER --engine="$GITHUB_WORKSPACE/out/x86/escargot" new-es |
| 152 | + $RUNNER --engine="$GITHUB_WORKSPACE/out/x64/escargot" new-es |
| 153 | + mv out/x86/escargot out/escargot-linux-x86 |
| 154 | + mv out/x64/escargot out/escargot-linux-x64 |
| 155 | + - name: Upload |
| 156 | + uses: actions/upload-artifact@v4 |
| 157 | + with: |
| 158 | + name: linux-result |
| 159 | + path: out/escargot-linux-* |
| 160 | + |
| 161 | + update-release: |
| 162 | + needs: [build-mac64, build-mac64arm, build-windows, build-linux] |
| 163 | + runs-on: ubuntu-latest |
| 164 | + steps: |
| 165 | + - name: Download mac64 result |
| 166 | + uses: actions/download-artifact@v4 |
| 167 | + with: |
| 168 | + name: mac64-result |
| 169 | + path: artifacts |
| 170 | + - name: Download mac64arm result |
| 171 | + uses: actions/download-artifact@v4 |
| 172 | + with: |
| 173 | + name: mac64arm-result |
| 174 | + path: artifacts |
| 175 | + - name: Download win32 result |
| 176 | + uses: actions/download-artifact@v4 |
| 177 | + with: |
| 178 | + name: win-x86-result |
| 179 | + path: artifacts |
| 180 | + - name: Download win64 result |
| 181 | + uses: actions/download-artifact@v4 |
| 182 | + with: |
| 183 | + name: win-x64-result |
| 184 | + path: artifacts |
| 185 | + - name: Download linux result |
| 186 | + uses: actions/download-artifact@v4 |
| 187 | + with: |
| 188 | + name: linux-result |
| 189 | + path: artifacts |
| 190 | + - name: Upload to release |
| 191 | + uses: softprops/action-gh-release@v2 |
| 192 | + with: |
| 193 | + files: | |
| 194 | + artifacts/escargot-* |
0 commit comments