|
| 1 | +name: Release |
| 2 | + |
| 3 | +concurrency: |
| 4 | + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} |
| 5 | + cancel-in-progress: true |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + build_ubuntu: |
| 11 | + description: 'Build Ubuntu' |
| 12 | + required: false |
| 13 | + default: 'true' |
| 14 | + build_macos: |
| 15 | + description: 'Build MacOS' |
| 16 | + required: false |
| 17 | + default: 'true' |
| 18 | + build_windows: |
| 19 | + description: 'Build Windows' |
| 20 | + required: false |
| 21 | + default: 'true' |
| 22 | + release_tags: |
| 23 | + description: 'Release Page Tags' |
| 24 | + required: true |
| 25 | + |
| 26 | +jobs: |
| 27 | + build_ubuntu: |
| 28 | + name: Ubuntu |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + if: ${{ github.event.inputs.build_ubuntu == 'true' }} |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + os: [ubuntu-22.04] |
| 34 | + rust: [1.79] |
| 35 | + env: |
| 36 | + LD_LIBRARY_PATH: ~\.wasmedge\lib |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Checkout sources |
| 40 | + uses: actions/checkout@v3 |
| 41 | + |
| 42 | + - name: Install WasmEdge |
| 43 | + run: | |
| 44 | + curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- --version=0.14.0 |
| 45 | + source $HOME/.wasmedge/env |
| 46 | + - name: Install dependencies |
| 47 | + run: | |
| 48 | + sudo apt-get update |
| 49 | + sudo apt-get install libssl-dev pkg-config llvm clang libclang-dev binfmt-support libxcursor-dev libx11-dev libasound2-dev libpulse-dev |
| 50 | +
|
| 51 | + - name: Install Rust-stable |
| 52 | + uses: dtolnay/rust-toolchain@stable |
| 53 | + with: |
| 54 | + toolchain: ${{ matrix.rust }} |
| 55 | + |
| 56 | + - name: Install cargo-packager |
| 57 | + run: | |
| 58 | + cargo +stable install --force --locked cargo-packager |
| 59 | +
|
| 60 | + - name: Build |
| 61 | + run: | |
| 62 | + source $HOME/.wasmedge/env |
| 63 | + cargo packager --release --verbose |
| 64 | + ls dist/ |
| 65 | +
|
| 66 | + - name: Upload Dist |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + run: | |
| 70 | + cd dist/ |
| 71 | + gh release upload ${{ github.event.inputs.release_tags }} moxin_*.deb --clobber |
| 72 | + gh release upload ${{ github.event.inputs.release_tags }} moxin_*.tar.gz --clobber |
| 73 | + gh release upload ${{ github.event.inputs.release_tags }} moxin_*.AppImage --clobber |
| 74 | +
|
| 75 | + build_macos: |
| 76 | + name: MacOS |
| 77 | + runs-on: ${{ matrix.os }} |
| 78 | + if: ${{ github.event.inputs.build_macos == 'true' }} |
| 79 | + strategy: |
| 80 | + matrix: |
| 81 | + os: [macos-14, macos-13] |
| 82 | + rust: [1.79] |
| 83 | + |
| 84 | + steps: |
| 85 | + - name: Checkout sources |
| 86 | + uses: actions/checkout@v3 |
| 87 | + |
| 88 | + - name: Install WasmEdge |
| 89 | + run: | |
| 90 | + curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- --version=0.14.0 |
| 91 | + source $HOME/.wasmedge/env |
| 92 | +
|
| 93 | + - name: Install Rust-stable |
| 94 | + uses: dtolnay/rust-toolchain@stable |
| 95 | + with: |
| 96 | + toolchain: ${{ matrix.rust }} |
| 97 | + |
| 98 | + - name: Install cargo-packager |
| 99 | + run: | |
| 100 | + cargo +stable install --force --locked cargo-packager |
| 101 | +
|
| 102 | + - name: Build |
| 103 | + run: | |
| 104 | + cargo packager --release --verbose |
| 105 | + ls dist/ |
| 106 | + |
| 107 | + - name: Upload Dist |
| 108 | + env: |
| 109 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 110 | + run: | |
| 111 | + cd dist/ |
| 112 | + gh release upload ${{ github.event.inputs.release_tags }} Moxin_*.dmg --clobber |
| 113 | +
|
| 114 | + build_windows: |
| 115 | + name: Windows |
| 116 | + runs-on: windows-2022 |
| 117 | + if: ${{ github.event.inputs.build_windows == 'true' }} |
| 118 | + strategy: |
| 119 | + matrix: |
| 120 | + rust: [1.79] |
| 121 | + env: |
| 122 | + WASMEDGE_DIR: ${{ github.workspace }}\WasmEdge-0.14.0-Windows |
| 123 | + steps: |
| 124 | + - name: Display ENV |
| 125 | + run: | |
| 126 | + echo $env:WASMEDGE_DIR |
| 127 | +
|
| 128 | + - name: Checkout sources |
| 129 | + uses: actions/checkout@v3 |
| 130 | + |
| 131 | + - name: Download WasmEdge |
| 132 | + run: | |
| 133 | + $ProgressPreference = 'SilentlyContinue' |
| 134 | + Invoke-WebRequest -Uri "https://github.com/WasmEdge/WasmEdge/releases/download/0.14.0/WasmEdge-0.14.0-windows.zip" -OutFile "WasmEdge-0.14.0-windows.zip" |
| 135 | + Expand-Archive -LiteralPath "WasmEdge-0.14.0-windows.zip" -DestinationPath ${{ github.workspace }} |
| 136 | + tree /F ${{ github.workspace }}\WasmEdge |
| 137 | +
|
| 138 | + - name: Set up Windows 10 SDK |
| 139 | + uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.11 |
| 140 | + with: |
| 141 | + sdk-version: 19041 |
| 142 | + |
| 143 | + - name: Install Rust-stable |
| 144 | + uses: dtolnay/rust-toolchain@stable |
| 145 | + with: |
| 146 | + toolchain: ${{ matrix.rust }} |
| 147 | + |
| 148 | + - name: Install cargo-packager |
| 149 | + run: | |
| 150 | + cargo +stable install --force --locked cargo-packager |
| 151 | +
|
| 152 | + - name: Build |
| 153 | + run: | |
| 154 | + cargo packager --release --formats nsis --verbose |
| 155 | + ls dist/ |
| 156 | + - name: Upload Dist |
| 157 | + env: |
| 158 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 159 | + run: | |
| 160 | + cd dist/ |
| 161 | + $file=Get-ChildItem -Filter *.exe |
| 162 | + gh release upload ${{ github.event.inputs.release_tags }} $file.name --clobber |
| 163 | +
|
0 commit comments