|
| 1 | +name: Iris Wallet Desktop CI |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-linux: |
| 8 | + runs-on: ubuntu-22.04 |
| 9 | + steps: |
| 10 | + - name: Checkout code with submodules |
| 11 | + uses: actions/checkout@v3 |
| 12 | + with: |
| 13 | + submodules: true |
| 14 | + fetch-depth: 1 |
| 15 | + submodule-fetch-depth: 1 |
| 16 | + |
| 17 | + - name: Install Rust |
| 18 | + run: | |
| 19 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 20 | + echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
| 21 | + source "$HOME/.cargo/env" |
| 22 | +
|
| 23 | + - name: Set up Python 3.12.3 |
| 24 | + uses: actions/setup-python@v5 |
| 25 | + with: |
| 26 | + python-version: "3.12.3" |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: | |
| 30 | + sudo apt update |
| 31 | + sudo apt install libxcb-cursor0 -y |
| 32 | + sudo apt-get install ruby-dev build-essential && sudo gem i fpm -f |
| 33 | +
|
| 34 | + - name: Clone rgb-lightning-node repository with submodules |
| 35 | + run: git clone https://github.com/RGB-Tools/rgb-lightning-node --recurse-submodules --shallow-submodules |
| 36 | + |
| 37 | + - name: Build the rgb-lightning-node binary |
| 38 | + working-directory: rgb-lightning-node |
| 39 | + run: cargo install --debug --path . |
| 40 | + |
| 41 | + - name: Copy rgb-lightning-node binary to root directory |
| 42 | + run: | |
| 43 | + mkdir ln_node_binary |
| 44 | + cp rgb-lightning-node/target/debug/rgb-lightning-node ln_node_binary |
| 45 | +
|
| 46 | + - name: Set environment variables from secrets and create config.py |
| 47 | + env: |
| 48 | + CLIENT_ID: ${{ secrets.CLIENT_ID }} |
| 49 | + PROJECT_ID: ${{ secrets.PROJECT_ID }} |
| 50 | + AUTH_URI: ${{ secrets.AUTH_URI }} |
| 51 | + TOKEN_URI: ${{ secrets.TOKEN_URI }} |
| 52 | + AUTH_PROVIDER_CERT_URL: ${{ secrets.AUTH_PROVIDER_CERT_URL }} |
| 53 | + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} |
| 54 | + run: | |
| 55 | + cd src/utils |
| 56 | + python generate_config.py |
| 57 | +
|
| 58 | + - name: Install python dependencies |
| 59 | + run: | |
| 60 | + pip install poetry |
| 61 | + pip install pyinstaller |
| 62 | + poetry install |
| 63 | +
|
| 64 | + - name: Compile QT resources |
| 65 | + run: | |
| 66 | + poetry run pyside6-rcc src/resources.qrc -o src/resources_rc.py |
| 67 | +
|
| 68 | + - name: Build the application |
| 69 | + run: | |
| 70 | + chmod +x build_linux.sh |
| 71 | + ./build_linux.sh |
| 72 | +
|
| 73 | + - name: Create AppImage |
| 74 | + run: | |
| 75 | + chmod +x build_appimage.sh |
| 76 | + ./build_appimage.sh |
| 77 | + ARCH=$(uname -m) |
| 78 | + APPIMAGE_NAME="iriswallet-${ARCH}.AppImage" |
| 79 | + echo "APPIMAGE_NAME=${APPIMAGE_NAME}" >> $GITHUB_ENV |
| 80 | + echo $APPIMAGE_NAME |
| 81 | +
|
| 82 | + - name: Upload Linux artifact |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: linux |
| 86 | + path: | |
| 87 | + iriswallet.deb |
| 88 | +
|
| 89 | + - name: Upload AppImage artifact |
| 90 | + uses: actions/upload-artifact@v4 |
| 91 | + with: |
| 92 | + name: linux_appimage |
| 93 | + path: | |
| 94 | + ${{ env.APPIMAGE_NAME }} |
| 95 | +
|
| 96 | + build-macos: |
| 97 | + runs-on: macos-latest |
| 98 | + steps: |
| 99 | + - name: Checkout code with submodules |
| 100 | + uses: actions/checkout@v3 |
| 101 | + with: |
| 102 | + submodules: true |
| 103 | + fetch-depth: 1 |
| 104 | + submodule-fetch-depth: 1 |
| 105 | + |
| 106 | + - name: Install Rust |
| 107 | + run: | |
| 108 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 109 | + echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
| 110 | + source "$HOME/.cargo/env" |
| 111 | +
|
| 112 | + - name: Set up Python 3.12.3 |
| 113 | + uses: actions/setup-python@v5 |
| 114 | + with: |
| 115 | + python-version: "3.12.3" |
| 116 | + |
| 117 | + - name: Clone rgb-lightning-node repository with submodules |
| 118 | + run: git clone https://github.com/RGB-Tools/rgb-lightning-node --recurse-submodules --shallow-submodules |
| 119 | + |
| 120 | + - name: Build the rgb-lightning-node binary |
| 121 | + working-directory: rgb-lightning-node |
| 122 | + run: cargo install --debug --path . |
| 123 | + |
| 124 | + - name: Copy rgb-lightning-node binary to root directory |
| 125 | + run: | |
| 126 | + mkdir ln_node_binary |
| 127 | + cp rgb-lightning-node/target/debug/rgb-lightning-node ln_node_binary |
| 128 | +
|
| 129 | + - name: Set environment variables from secrets and create config.py |
| 130 | + env: |
| 131 | + CLIENT_ID: ${{ secrets.CLIENT_ID }} |
| 132 | + PROJECT_ID: ${{ secrets.PROJECT_ID }} |
| 133 | + AUTH_URI: ${{ secrets.AUTH_URI }} |
| 134 | + TOKEN_URI: ${{ secrets.TOKEN_URI }} |
| 135 | + AUTH_PROVIDER_CERT_URL: ${{ secrets.AUTH_PROVIDER_CERT_URL }} |
| 136 | + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} |
| 137 | + run: | |
| 138 | + cd src/utils |
| 139 | + python generate_config.py |
| 140 | +
|
| 141 | + - name: Install python dependencies |
| 142 | + run: | |
| 143 | + pip install poetry |
| 144 | + pip install pyinstaller |
| 145 | + poetry install |
| 146 | +
|
| 147 | + - name: Compile QT resources |
| 148 | + run: | |
| 149 | + poetry run pyside6-rcc src/resources.qrc -o src/resources_rc.py |
| 150 | +
|
| 151 | + - name: Build the application |
| 152 | + run: | |
| 153 | + chmod +x build_macos.sh |
| 154 | + ./build_macos.sh |
| 155 | +
|
| 156 | + - name: Upload macOS artifact |
| 157 | + uses: actions/upload-artifact@v4 |
| 158 | + with: |
| 159 | + name: macos |
| 160 | + path: iriswallet* |
| 161 | + |
| 162 | + build-windows: |
| 163 | + runs-on: windows-latest |
| 164 | + steps: |
| 165 | + - name: Checkout code with submodules |
| 166 | + uses: actions/checkout@v3 |
| 167 | + with: |
| 168 | + submodules: true |
| 169 | + fetch-depth: 1 |
| 170 | + submodule-fetch-depth: 1 |
| 171 | + |
| 172 | + - name: Install Rust |
| 173 | + run: | |
| 174 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 175 | +
|
| 176 | + - name: Set up Python 3.12 |
| 177 | + uses: actions/setup-python@v5 |
| 178 | + with: |
| 179 | + python-version: "3.12" |
| 180 | + |
| 181 | + - name: Clone rgb-lightning-node repository with submodules |
| 182 | + run: git clone https://github.com/RGB-Tools/rgb-lightning-node --recurse-submodules --shallow-submodules |
| 183 | + |
| 184 | + - name: Build the rgb-lightning-node binary |
| 185 | + working-directory: rgb-lightning-node |
| 186 | + run: cargo install --debug --path . |
| 187 | + |
| 188 | + - name: Copy rgb-lightning-node binary to root directory |
| 189 | + run: | |
| 190 | + mkdir ln_node_binary |
| 191 | + copy rgb-lightning-node\\target\\debug\\rgb-lightning-node.exe ln_node_binary |
| 192 | +
|
| 193 | + - name: Generate config.py with secrets and inno Setup script with dynamic version |
| 194 | + env: |
| 195 | + CLIENT_ID: ${{ secrets.CLIENT_ID }} |
| 196 | + PROJECT_ID: ${{ secrets.PROJECT_ID }} |
| 197 | + AUTH_URI: ${{ secrets.AUTH_URI }} |
| 198 | + TOKEN_URI: ${{ secrets.TOKEN_URI }} |
| 199 | + AUTH_PROVIDER_CERT_URL: ${{ secrets.AUTH_PROVIDER_CERT_URL }} |
| 200 | + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} |
| 201 | + run: | |
| 202 | + cd src/utils |
| 203 | + python generate_config.py |
| 204 | + python generate_iss.py |
| 205 | +
|
| 206 | + - name: Install python dependencies |
| 207 | + run: | |
| 208 | + pip install poetry |
| 209 | + pip install pyinstaller |
| 210 | + poetry install |
| 211 | +
|
| 212 | + - name: Compile QT resources and build exe |
| 213 | + run: | |
| 214 | + poetry run pyside6-rcc src/resources.qrc -o src/resources_rc.py |
| 215 | + poetry run pyinstaller iris_wallet_desktop.spec |
| 216 | +
|
| 217 | + - name: Build the application |
| 218 | + uses: Minionguyjpro/[email protected] |
| 219 | + with: |
| 220 | + path: updated_iriswallet.iss |
| 221 | + |
| 222 | + - name: Upload Windows artifact |
| 223 | + uses: actions/upload-artifact@v4 |
| 224 | + with: |
| 225 | + name: windows |
| 226 | + path: iriswallet.exe |
| 227 | + |
| 228 | + |
| 229 | + upload-release: |
| 230 | + if: needs.build-linux.result == 'success' || needs.build-macos.result == 'success' || needs.build-windows.result == 'success' |
| 231 | + runs-on: ubuntu-latest |
| 232 | + needs: [build-linux, build-macos, build-windows] |
| 233 | + permissions: |
| 234 | + contents: write |
| 235 | + steps: |
| 236 | + - uses: actions/checkout@v4 |
| 237 | + |
| 238 | + - name: Read version from VERSION.py |
| 239 | + run: | |
| 240 | + VERSION=$(grep '__version__' src/version.py | cut -d "'" -f 2) |
| 241 | + echo "TAG_NAME=v${VERSION}" >> $GITHUB_ENV |
| 242 | + echo "RELEASE_NAME=Release v${VERSION}" >> $GITHUB_ENV |
| 243 | + ARCH=$(uname -m) |
| 244 | + APPIMAGE_NAME="iriswallet-${ARCH}.AppImage" |
| 245 | + echo "APPIMAGE_NAME=${APPIMAGE_NAME}" >> $GITHUB_ENV |
| 246 | + echo $APPIMAGE_NAME |
| 247 | + APPNAME_MAC="iriswallet ${VERSION}".dmg |
| 248 | + echo "APPNAME_MAC=${APPNAME_MAC}" >> $GITHUB_ENV |
| 249 | + echo $APPNAME_MAC |
| 250 | +
|
| 251 | +
|
| 252 | + - name: Create GitHub Release |
| 253 | + id: create_release |
| 254 | + uses: actions/create-release@v1 |
| 255 | + env: |
| 256 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 257 | + with: |
| 258 | + tag_name: "${{ env.TAG_NAME }}" |
| 259 | + release_name: "${{ env.RELEASE_NAME }}" |
| 260 | + draft: false |
| 261 | + prerelease: false |
| 262 | + |
| 263 | + - name: Create uploads folder |
| 264 | + run: mkdir -p ./uploads |
| 265 | + |
| 266 | + - name: Download Linux artifact |
| 267 | + uses: actions/download-artifact@v4 |
| 268 | + with: |
| 269 | + name: linux # Name of the Linux artifact |
| 270 | + path: ./uploads # Destination path folder |
| 271 | + |
| 272 | + - name: Download Linux AppImage artifact |
| 273 | + uses: actions/download-artifact@v4 |
| 274 | + with: |
| 275 | + name: linux_appimage # Name of the Linux artifact |
| 276 | + path: ./uploads # Destination path folder |
| 277 | + - name: Download macOS artifact |
| 278 | + uses: actions/download-artifact@v4 |
| 279 | + with: |
| 280 | + name: macos # Name of the macOS artifact |
| 281 | + path: ./uploads # Destination path folder |
| 282 | + |
| 283 | + - name: Download windows artifact |
| 284 | + uses: actions/download-artifact@v4 |
| 285 | + with: |
| 286 | + name: windows # Name of the windows artifact |
| 287 | + path: ./uploads # Destination path folder |
| 288 | + |
| 289 | + - name: Upload Release Artifact Linux DEB |
| 290 | + uses: actions/upload-release-asset@v1 |
| 291 | + env: |
| 292 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 293 | + with: |
| 294 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 295 | + asset_path: ./uploads/iriswallet.deb |
| 296 | + asset_name: iris-wallet-desktop-linux-"${{ env.TAG_NAME }}".deb |
| 297 | + asset_content_type: application/vnd.debian.binary-package |
| 298 | + |
| 299 | + - name: Upload Release Artifact Linux AppImage |
| 300 | + uses: actions/upload-release-asset@v1 |
| 301 | + env: |
| 302 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 303 | + with: |
| 304 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 305 | + asset_path: ./uploads/${{ env.APPIMAGE_NAME }} |
| 306 | + asset_name: iris-wallet-desktop-"${{ env.TAG_NAME }}".AppImage |
| 307 | + asset_content_type: application/octet-stream |
| 308 | + |
| 309 | + - name: Upload Release Artifact windows |
| 310 | + uses: actions/upload-release-asset@v1 |
| 311 | + env: |
| 312 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 313 | + with: |
| 314 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 315 | + asset_path: ./uploads/iriswallet.exe |
| 316 | + asset_name: iris-wallet-desktop-windows-"${{ env.TAG_NAME }}".exe |
| 317 | + asset_content_type: application/vnd.microsoft.portable-executable |
| 318 | + |
| 319 | + - name: Upload Release Artifact macOS |
| 320 | + uses: actions/upload-release-asset@v1 |
| 321 | + env: |
| 322 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 323 | + with: |
| 324 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 325 | + asset_path: ./uploads/${{ env.APPNAME_MAC }} |
| 326 | + asset_name: iris-wallet-desktop-macos-"${{ env.TAG_NAME }}".dmg |
| 327 | + asset_content_type: application/octet-stream |
| 328 | + |
| 329 | + cleanup: |
| 330 | + if: always() |
| 331 | + runs-on: ubuntu-latest |
| 332 | + needs: [build-linux, build-macos, build-windows,upload-release] |
| 333 | + steps: |
| 334 | + - uses: actions/checkout@v4 |
| 335 | + |
| 336 | + - name: Cleanup Artifacts |
| 337 | + uses: geekyeggo/delete-artifact@v5 |
| 338 | + with: |
| 339 | + name: | |
| 340 | + linux |
| 341 | + linux_appimage |
| 342 | + macos |
| 343 | + windows |
| 344 | + failOnError: false |
0 commit comments