Release #1848
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Release | |
| 'on': | |
| push: | |
| paths-ignore: | |
| - '**/*.md' | |
| branches: | |
| - 'release' | |
| - 'beta' | |
| - 'build-*' | |
| schedule: | |
| - cron: '05 00 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| # version: | |
| # type: string | |
| # description: 'override build version' | |
| platforms: | |
| default: Supported | |
| required: true | |
| description: 'target build platform' | |
| type: choice | |
| options: | |
| - Supported | |
| - Windows | |
| - MacOS | |
| - Linux-x64 | |
| - Linux-arm64 | |
| - Linux-x64-rpm | |
| - Linux-arm64-rpm | |
| tari_network: | |
| default: esmeralda | |
| required: true | |
| description: 'target testNet' | |
| type: choice | |
| options: | |
| - esmeralda | |
| - nextnet | |
| - mainnet | |
| - localnet | |
| - igor | |
| concurrency: | |
| # https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/release' }} | |
| permissions: {} | |
| env: | |
| TS_FEATURES: release-ci | |
| BETA_STRING: '(Beta)' | |
| jobs: | |
| set-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| tari_network: ${{ steps.set-matrix.outputs.tari_network }} | |
| tari_target_network: ${{ steps.set-matrix.outputs.tari_target_network }} | |
| steps: | |
| - id: set-matrix | |
| run: | | |
| # set -xueo pipefail | |
| if [[ "${{ github.ref }}" =~ ^refs/heads/release* ]] && [ "${{ github.event_name }}" != "workflow_dispatch" ] ; then | |
| echo "Release Build - Build everything for mainNet" | |
| echo "tari_network=mainnet" >> $GITHUB_OUTPUT | |
| echo "tari_target_network=mainnet" >> $GITHUB_OUTPUT | |
| elif [ "${{ github.event_name }}" == "workflow_dispatch" ] ; then | |
| echo "Ad-hoc Build - selective" | |
| echo "tari_network=${{ github.event.inputs.tari_network }}" >> $GITHUB_OUTPUT | |
| NETWORK="${{ github.event.inputs.tari_network }}" | |
| if [ "$NETWORK" = "esmeralda" ] || [ "$NETWORK" = "localnet" ] || [ "$NETWORK" = "igor" ]; then | |
| echo "tari_target_network=testnet" >> $GITHUB_OUTPUT | |
| else | |
| echo "tari_target_network=$NETWORK" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "Other builds" | |
| echo "tari_network=esmeralda" >> $GITHUB_OUTPUT | |
| echo "tari_target_network=testnet" >> $GITHUB_OUTPUT | |
| fi | |
| inputPlatforms=${{ github.event.inputs.platforms }} | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${inputPlatforms}" != "Supported" ]; then | |
| case "${inputPlatforms}" in | |
| Linux-x64) | |
| matrix='{"include":[{"platform":"ubuntu-22.04","args":"--bundles deb,appimage","extra":"-x64"}]}' | |
| ;; | |
| Linux-arm64) | |
| matrix='{"include":[{"platform":"ubuntu-22.04-arm","args":"--bundles deb,appimage"}]}' | |
| ;; | |
| Linux-x64-rpm) | |
| matrix='{"include":[{"platform":"ubuntu-22.04","args":"--bundles rpm","extra":"-x64-rpm"}]}' | |
| ;; | |
| Linux-arm64-rpm) | |
| matrix='{"include":[{"platform":"ubuntu-22.04-arm","args":"--bundles rpm","extra":"-rpm"}]}' | |
| ;; | |
| MacOS) | |
| matrix='{"include":[{"platform":"macos-latest","args":"--target universal-apple-darwin"}]}' | |
| ;; | |
| Windows) | |
| matrix='{"include":[{"platform":"windows-latest","args":"--bundles msi"}]}' | |
| ;; | |
| esac | |
| else | |
| # Supported / default builds systems | |
| # Windows x64 and MacOS universal | |
| # Linux - Too many people with too many variations. | |
| # We can't handle all the linux versions right now it's spreading efforts too thin. | |
| # Linux rpm - Too slow. Maybe some day though... some day... | |
| matrix='{"include":[ | |
| {"platform":"windows-latest","args":"--bundles msi"}, | |
| {"platform":"macos-latest","args":"--target universal-apple-darwin"} | |
| ]}' | |
| fi | |
| # Setup the json build matrix | |
| echo $matrix | |
| echo $matrix | jq . | |
| echo "matrix=$(echo "${matrix}" | jq -c .)" >> $GITHUB_OUTPUT | |
| builds: | |
| name: Building ${{ matrix.platform }}${{ matrix.extra }} for ${{ needs.set-matrix.outputs.tari_network }} | |
| needs: set-matrix | |
| # best effort disabled by default | |
| continue-on-error: ${{ matrix.best_effort || false }} | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.set-matrix.outputs.matrix) }} | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Builds - Install dependencies (windows) [yq] | |
| if: ${{ startsWith(runner.os,'Windows') }} | |
| run: | | |
| choco upgrade yq -y | |
| - name: Builds - Install dependencies (linux) [yq] | |
| if: ${{ startsWith(runner.os,'Linux') }} | |
| shell: bash | |
| run: | | |
| sudo bash ./scripts/check-get-yq.sh | |
| - name: BETA Builds - Set environment variables - ${{ needs.set-matrix.outputs.tari_network }} | |
| if: ${{ ! startsWith(github.ref, 'refs/heads/release') }} | |
| env: | |
| AIRDROP_BASE_URL: ${{ secrets.BETA_AIRDROP_BASE_URL }} | |
| AIRDROP_API_BASE_URL: ${{ secrets.BETA_AIRDROP_API_BASE_URL }} | |
| TELEMETRY_API_URL: ${{ secrets.BETA_TELEMETRY_API_URL }} | |
| EXCHANGE_ID: universal | |
| AIRDROP_WEBSOCKET_CRYPTO_KEY: ${{ secrets.DEV_AIRDROP_WEBSOCKET_CRYPTO_KEY }} | |
| BRIDGE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.ESMERALDA_BRIDGE_WALLET_CONNECT_PROJECT_ID }} | |
| BRIDGE_BACKEND_API_URL: ${{ secrets.ESMERALDA_BRIDGE_BACKEND_API_URL }} | |
| # Used for linux formatting | |
| OS_BINARY_NAME: ${{ runner.os == 'Linux' && 'tari_universe' || 'Tari Universe' }} | |
| OS_BETA_DATE_SUFFIX: ${{ runner.os == 'Linux' && '-' || ' - ' }} | |
| shell: bash | |
| run: | | |
| # Make envs available to other steps | |
| echo "TARI_NETWORK=${{ needs.set-matrix.outputs.tari_network }}" >> $GITHUB_ENV | |
| echo "TARI_TARGET_NETWORK=${{ needs.set-matrix.outputs.tari_target_network }}" >> $GITHUB_ENV | |
| echo "AIRDROP_BASE_URL=${{ env.AIRDROP_BASE_URL }}" >> $GITHUB_ENV | |
| echo "AIRDROP_API_BASE_URL=${{ env.AIRDROP_API_BASE_URL }}" >> $GITHUB_ENV | |
| echo "TELEMETRY_API_URL=${{ env.TELEMETRY_API_URL }}" >> $GITHUB_ENV | |
| echo "EXCHANGE_ID=universal" >> $GITHUB_ENV | |
| echo "AIRDROP_WEBSOCKET_CRYPTO_KEY=${{ env.AIRDROP_WEBSOCKET_CRYPTO_KEY }}" >> $GITHUB_ENV | |
| echo "BRIDGE_WALLET_CONNECT_PROJECT_ID=${{ env.BRIDGE_WALLET_CONNECT_PROJECT_ID }}" >> $GITHUB_ENV | |
| echo "BRIDGE_BACKEND_API_URL=${{ env.BRIDGE_BACKEND_API_URL }}" >> $GITHUB_ENV | |
| # GitHub Actions does not expand environment variables dynamically in envs | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| OS_BETA_STRING=-${BETA_STRING} | |
| BETA_STRING_SAFE=$(echo ${BETA_STRING} | sed 's/[^a-zA-Z0-9]/_/g') | |
| OS_BETA_STRING_BinName=-${BETA_STRING_SAFE} | |
| else | |
| OS_BETA_STRING=\ ${BETA_STRING} | |
| OS_BETA_STRING_BinName=\ ${BETA_STRING} | |
| fi | |
| echo "OS_BETA_STRING is ${OS_BETA_STRING}" | |
| echo "OS_BETA_STRING_BinName is ${OS_BETA_STRING_BinName}" | |
| echo "TS_FEATURES=release-ci-beta" >> $GITHUB_ENV | |
| # numeric-only and cannot be greater than 65535 for msi target | |
| export BETA_DATE=$(date +%m%d) | |
| echo "BETA_DATE=${BETA_DATE}" >> $GITHUB_ENV | |
| cd "${GITHUB_WORKSPACE}/src-tauri" | |
| echo "releaseName=Tari Universe ${{ env.BETA_STRING }} v__VERSION__-${BETA_DATE}" >> $GITHUB_ENV | |
| # Don't mess with the double quotes and inner escaped quotes | |
| yq eval ".productName = \"${{ env.OS_BINARY_NAME }}${OS_BETA_STRING}${{ env.OS_BETA_DATE_SUFFIX }}${BETA_DATE}\"" --output-format=json -i tauri.conf.json | |
| yq eval ".mainBinaryName = \"${{ env.OS_BINARY_NAME }}${OS_BETA_STRING_BinName}${{ env.OS_BETA_DATE_SUFFIX }}${BETA_DATE}\"" --output-format=json -i tauri.conf.json | |
| yq eval ".app.windows[0].title = \"Tari Universe ${{ env.BETA_STRING }} - ${BETA_DATE} | ${{ needs.set-matrix.outputs.tari_network }}\"" --output-format=json -i tauri.conf.json | |
| yq eval ".build.beforeBuildCommand = \"pnpm run build -- --mode development\"" --output-format=json -i tauri.conf.json | |
| yq eval ".identifier = \"com.tari.universe.beta\"" --output-format=json -i tauri.conf.json | |
| yq eval ".plugins.updater.endpoints = [\"https://raw.githubusercontent.com/tari-project/universe/main/.updater/beta-latest.json\"]" \ | |
| --output-format=json -i tauri.conf.json | |
| cat tauri.conf.json | |
| sed -i.bak -e "s/\"icons\//\"beta-icons\//g" tauri.conf.json | |
| - name: RELEASE Builds - Set environment variables | |
| if: ${{ startsWith(github.ref, 'refs/heads/release') }} | |
| env: | |
| AIRDROP_WEBSOCKET_CRYPTO_KEY: ${{ secrets.PROD_AIRDROP_WEBSOCKET_CRYPTO_KEY }} | |
| BRIDGE_WALLET_CONNECT_PROJECT_ID: ${{ secrets.MAINNET_BRIDGE_WALLET_CONNECT_PROJECT_ID }} | |
| BRIDGE_BACKEND_API_URL: ${{ secrets.MAINNET_BRIDGE_BACKEND_API_URL }} | |
| # Used for linux formatting | |
| OS_BINARY_NAME: ${{ runner.os == 'Linux' && 'tari_universe' || 'Tari Universe' }} | |
| shell: bash | |
| run: | | |
| # Setup tauri action envs | |
| echo "tagName=v__VERSION__" >> $GITHUB_ENV | |
| echo "releaseName=Tari Universe v__VERSION__" >> $GITHUB_ENV | |
| #echo "releaseId=" >> $GITHUB_ENV | |
| echo "TARI_NETWORK=${{ needs.set-matrix.outputs.tari_network }}" >> $GITHUB_ENV | |
| echo "TARI_TARGET_NETWORK=${{ needs.set-matrix.outputs.tari_target_network }}" >> $GITHUB_ENV | |
| echo "AIRDROP_WEBSOCKET_CRYPTO_KEY=${{ env.AIRDROP_WEBSOCKET_CRYPTO_KEY }}" >> $GITHUB_ENV | |
| echo "BRIDGE_WALLET_CONNECT_PROJECT_ID=${{ env.BRIDGE_WALLET_CONNECT_PROJECT_ID }}" >> $GITHUB_ENV | |
| echo "BRIDGE_BACKEND_API_URL=${{ env.BRIDGE_BACKEND_API_URL }}" >> $GITHUB_ENV | |
| cd "${GITHUB_WORKSPACE}/src-tauri" | |
| TU_VERSION=$(jq -r .version tauri.conf.json) | |
| # Don't mess with the double quotes and inner escaped quotes | |
| yq eval ".productName = \"${{ env.OS_BINARY_NAME }}\"" --output-format=json -i tauri.conf.json | |
| yq eval ".mainBinaryName = \"${{ env.OS_BINARY_NAME }}\"" --output-format=json -i tauri.conf.json | |
| yq eval ".app.windows[0].title = \"Tari Universe v${TU_VERSION}\"" --output-format=json -i tauri.conf.json | |
| yq eval ".identifier = \"com.tari.universe\"" --output-format=json -i tauri.conf.json | |
| yq eval ".plugins.updater.endpoints = [\"https://raw.githubusercontent.com/tari-project/universe/main/.updater/latest.json\", \"https://cdn-universe.tari.com/tari-project/universe/updater/latest.json\"]" \ | |
| --output-format=json -i tauri.conf.json | |
| - uses: pnpm/action-setup@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| cache: 'pnpm' | |
| - name: Rust Setup | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} | |
| - name: Cache Cargo files and outputs | |
| if: ${{ ( ! startsWith(github.ref, 'refs/heads/release') ) && ( ! startsWith(github.ref, 'refs/tags/v') ) }} | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: './src-tauri -> target' | |
| - name: Install Dependencies - Linux | |
| if: startsWith(runner.os,'Linux') | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --no-install-recommends --assume-yes \ | |
| libwebkit2gtk-4.1-dev \ | |
| libappindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf \ | |
| libprotobuf-dev \ | |
| protobuf-compiler | |
| - name: Install Dependencies - Linux/AppImage | |
| if: ${{ ( startsWith(runner.os,'Linux') ) && ( contains(matrix.args, 'appimage') ) }} | |
| run: | | |
| sudo apt-get install --no-install-recommends --assume-yes \ | |
| appstream | |
| - name: Install Dependencies - Linux/OpenCL | |
| if: startsWith(runner.os,'Linux') | |
| run: | | |
| sudo apt-get install --no-install-recommends --assume-yes \ | |
| opencl-headers \ | |
| ocl-icd-opencl-dev | |
| # We set "bundleMediaFramework" to true, it should bundle into appimage all needed libraries for playing videos | |
| # It requires us to set ARCH environment variable | |
| - name: BundleMediaFramework fix - [ Linux Appimage ] | |
| if: ${{ ( startsWith(runner.os,'Linux') ) && ( contains(matrix.args, 'appimage') ) }} | |
| run: echo "ARCH=$(uname -m)" >> $GITHUB_ENV | |
| - name: Install Dependencies - macOS | |
| if: startsWith(runner.os,'macOS') | |
| run: | | |
| # openssl, cmake and autoconf already installed | |
| brew install zip coreutils automake protobuf libtool | |
| # force install rust OSX multi-arch components | |
| cd src-tauri | |
| rustup target add x86_64-apple-darwin | |
| rustup target add aarch64-apple-darwin | |
| rustup toolchain install stable-x86_64-apple-darwin --force-non-host | |
| rustup toolchain install stable-aarch64-apple-darwin --force-non-host | |
| - name: Install Dependencies - Windows | |
| if: startsWith(runner.os,'Windows') | |
| run: | | |
| vcpkg.exe install sqlite3:x64-windows zlib:x64-windows | |
| choco upgrade protoc -y | |
| - name: Install Dependencies - Windows/OpenCL | |
| if: startsWith(runner.os,'Windows') | |
| run: | | |
| vcpkg.exe --triplet=x64-windows install opencl | |
| - name: Set environment variables - Windows | |
| if: startsWith(runner.os,'Windows') | |
| shell: bash | |
| run: | | |
| echo "SQLITE3_LIB_DIR=C:\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV | |
| echo "LIB=C:\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV | |
| - name: Azure Code-signing Setup - Windows Only | |
| if: ${{ ( startsWith(runner.os,'Windows') ) && ( env.AZURE_TENANT_ID != '' ) }} | |
| shell: bash | |
| env: | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| WINDOWS_SIGN_COMMAND: trusted-signing-cli -e https://eus.codesigning.azure.net/ -a Tari -d 'TariUniverse' -c Tarilabs %1 | |
| run: | | |
| cd "${GITHUB_WORKSPACE}/src-tauri" | |
| echo '{}' > ./tauri.windows.conf.json | |
| yq eval ".bundle.windows.signCommand = env(WINDOWS_SIGN_COMMAND)" --output-format=json -i ./tauri.windows.conf.json | |
| cat ./tauri.windows.conf.json | |
| cargo install trusted-signing-cli@0.8.0 --locked | |
| - name: Install Dependencies - Node | |
| run: | | |
| pnpm --version | |
| pnpm install | |
| - name: Build process-wrapper | |
| shell: bash | |
| run: | | |
| if [[ "${{ matrix.platform }}" == "macos-latest" && "${{ matrix.args }}" == *"universal-apple-darwin"* ]]; then | |
| # Build for both architectures on macOS universal | |
| cargo build --release --manifest-path process-wrapper/Cargo.toml --target aarch64-apple-darwin | |
| cargo build --release --manifest-path process-wrapper/Cargo.toml --target x86_64-apple-darwin | |
| # Create universal binary via lipo | |
| mkdir -p target/universal-apple-darwin/release | |
| lipo -create \ | |
| target/aarch64-apple-darwin/release/process-wrapper \ | |
| target/x86_64-apple-darwin/release/process-wrapper \ | |
| -output target/universal-apple-darwin/release/process-wrapper | |
| chmod +x target/universal-apple-darwin/release/process-wrapper | |
| # Pre-place the binary for Tauri bundling (build.rs only runs per-arch, not for universal) | |
| mkdir -p src-tauri/binaries | |
| cp target/universal-apple-darwin/release/process-wrapper src-tauri/binaries/process-wrapper-universal-apple-darwin | |
| else | |
| cargo build --release --manifest-path process-wrapper/Cargo.toml | |
| fi | |
| - name: Prepare macOS notary API key | |
| if: ${{ startsWith(runner.os, 'macOS') }} | |
| env: | |
| MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }} | |
| run: printf '%s' "$MACOS_NOTARY_KEY" > "$RUNNER_TEMP/notary_key.p8" | |
| - name: Build Tauri Apps | |
| id: build | |
| uses: tauri-apps/tauri-action@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE || secrets.AZURE_TENANT_ID }} | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
| APPLE_API_ISSUER: ${{ secrets.MACOS_NOTARY_ISSUER }} | |
| APPLE_API_KEY: ${{ secrets.MACOS_NOTARY_KEY_ID }} | |
| APPLE_API_KEY_PATH: ${{ runner.temp }}/notary_key.p8 | |
| AZURE_TENANT_ID: ${{ startsWith(runner.os,'Windows') && secrets.AZURE_TENANT_ID }} | |
| AZURE_CLIENT_ID: ${{ startsWith(runner.os,'Windows') && secrets.AZURE_CLIENT_ID }} | |
| AZURE_CLIENT_SECRET: ${{ startsWith(runner.os,'Windows') && secrets.AZURE_CLIENT_SECRET }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| with: | |
| tagName: ${{ env.tagName }} | |
| releaseName: ${{ env.releaseName }} | |
| releaseBody: 'Tari Universe - See the assets to download this version and install' | |
| releaseDraft: true | |
| prerelease: true | |
| includeDebug: false | |
| includeRelease: true | |
| args: ${{ matrix.args }} --features "${{ env.TS_FEATURES }}" | |
| - name: Add msbuild to PATH (windows) | |
| uses: microsoft/setup-msbuild@v3 | |
| if: startsWith(runner.os,'Windows') | |
| - name: Build bundled WiX Windows installer | |
| if: ${{ startsWith(runner.os,'Windows') }} | |
| env: | |
| TARI_UNIVERSE_APP_VERSION: ${{ steps.build.outputs.appVersion }} | |
| WIX_LOGLEVEL: Verbose | |
| shell: bash | |
| run: | | |
| mkdir -p "tari-win-bundler/executables" | |
| cd "tari-win-bundler/executables" | |
| # https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 | |
| curl -s --location --remote-name "https://aka.ms/vs/17/release/vc_redist.x64.exe" | |
| cd ../.. | |
| ls -la "target/release/bundle/msi" | |
| ls -la "tari-win-bundler/executables" | |
| if [[ "$GITHUB_REF" == refs/heads/release ]]; then | |
| # release | |
| export TARI_UNIVERSE_BUNDLER_NAME="Tari Universe_${{ env.TARI_UNIVERSE_APP_VERSION }}_x64_en-US" | |
| export TARI_UNIVERSE_EXECUTABLE_AND_FOLDER_NAME="Tari Universe" | |
| export TARI_UNIVERSE_UPGRADE_CODE=ed60939d-f2b8-5b6e-a7af-bd0d5cf13e37 | |
| else | |
| # Beta / Other | |
| export TARI_UNIVERSE_BUNDLER_NAME="Tari Universe ${{ env.BETA_STRING }} - ${{ env.BETA_DATE }}_${{ env.TARI_UNIVERSE_APP_VERSION }}_x64_en-US" | |
| export TARI_UNIVERSE_EXECUTABLE_AND_FOLDER_NAME="Tari Universe ${{ env.BETA_STRING }} - ${{ env.BETA_DATE }}" | |
| export TARI_UNIVERSE_UPGRADE_CODE=ab60939d-f2b8-5b6e-a7af-bd0d5cf13e21 | |
| fi | |
| export TARI_UNIVERSE_INSTALLER_NAME="${TARI_UNIVERSE_BUNDLER_NAME}.msi" | |
| echo "TARI_UNIVERSE_INSTALLER_NAME is ${TARI_UNIVERSE_INSTALLER_NAME}" | |
| echo "TARI_UNIVERSE_INSTALLER_NAME=${TARI_UNIVERSE_INSTALLER_NAME}" >> $GITHUB_ENV | |
| echo "TARI_UNIVERSE_BUNDLER_NAME is ${TARI_UNIVERSE_BUNDLER_NAME}" | |
| echo "TARI_UNIVERSE_BUNDLER_NAME=${TARI_UNIVERSE_BUNDLER_NAME}" >> $GITHUB_ENV | |
| echo "TARI_UNIVERSE_EXECUTABLE_AND_FOLDER_NAME is ${TARI_UNIVERSE_EXECUTABLE_AND_FOLDER_NAME}" | |
| echo "TARI_UNIVERSE_EXECUTABLE_AND_FOLDER_NAME=${TARI_UNIVERSE_EXECUTABLE_AND_FOLDER_NAME}" >> $GITHUB_ENV | |
| echo "TARI_UNIVERSE_UPGRADE_CODE is ${TARI_UNIVERSE_UPGRADE_CODE}" | |
| dotnet tool install --global wix --version 5.0.2 | |
| wix extension add WixToolset.Util.wixext/5.0.2 | |
| wix extension add WixToolset.BootstrapperApplications.wixext/5.0.2 | |
| wix extension list | |
| wix build tari-win-bundler/Bundle.wxs \ | |
| -ext WixToolset.Util.wixext \ | |
| -ext WixToolset.BootstrapperApplications.wixext \ | |
| -includepath tari-win-bundler \ | |
| -includepath tari-win-bundler/resources \ | |
| -includepath tari-win-bundler/executables \ | |
| -includepath wix \ | |
| -includepath target/release/bundle/msi | |
| ls -la target/release/bundle/msi | |
| ls -la tari-win-bundler | |
| ls -la tari-win-bundler/executables | |
| mv -v ./tari-win-bundler/Bundle.exe "./tari-win-bundler/${TARI_UNIVERSE_BUNDLER_NAME}_unsigned.exe" | |
| - name: Sign Bundled Windows Installer | |
| if: ${{ ( startsWith(runner.os,'Windows') ) && ( env.AZURE_TENANT_ID != '' ) }} | |
| shell: bash | |
| env: | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| run: | | |
| wix burn detach "./tari-win-bundler/${TARI_UNIVERSE_BUNDLER_NAME}_unsigned.exe" -engine ./tari-win-bundler/burnengine.exe | |
| trusted-signing-cli -e https://eus.codesigning.azure.net/ -a Tari -d TariUniverse -c Tarilabs ./tari-win-bundler/burnengine.exe | |
| wix burn reattach "./tari-win-bundler/${TARI_UNIVERSE_BUNDLER_NAME}_unsigned.exe" -engine ./tari-win-bundler/burnengine.exe -o "./tari-win-bundler/${TARI_UNIVERSE_BUNDLER_NAME}.exe" | |
| trusted-signing-cli -e https://eus.codesigning.azure.net/ -a Tari -d TariUniverse -c Tarilabs "./tari-win-bundler/${TARI_UNIVERSE_BUNDLER_NAME}.exe" | |
| - name: Verify signing for Bundled Windows installer | |
| if: ${{ ( startsWith(runner.os,'Windows') ) && ( env.AZURE_TENANT_ID != '' ) }} | |
| continue-on-error: true | |
| env: | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| shell: powershell | |
| run: | | |
| # Get the Program Files (x86) directory dynamically | |
| $programFilesX86 = [System.Environment]::GetFolderPath("ProgramFilesX86") | |
| $sdkBasePath = Join-Path $programFilesX86 "Windows Kits" | |
| # Check if Windows Kits exists | |
| if (-Not (Test-Path $sdkBasePath)) { | |
| Write-Error "Windows Kits folder not found at $sdkBasePath!" | |
| exit 1 | |
| } | |
| Write-Output "Searching for signtool.exe in: $sdkBasePath" | |
| # Search for signtool.exe within Windows Kits fold with x64 in the path | |
| $signtoolPath = Get-ChildItem -Path $sdkBasePath -Recurse -Filter signtool.exe -ErrorAction SilentlyContinue | | |
| Where-Object { $_.FullName -match '\\x64\\' } | | |
| Select-Object -ExpandProperty FullName -First 1 | |
| if (-not $signtoolPath) { | |
| Write-Error "signtool.exe not found in Windows Kits folder!" | |
| exit 1 | |
| } | |
| Write-Output "Found signtool.exe at: $signtoolPath" | |
| cd tari-win-bundler | |
| $Signature = Get-AuthenticodeSignature "${{ env.TARI_UNIVERSE_BUNDLER_NAME }}.exe" | |
| # Display results | |
| Write-Host "File: ${{ env.TARI_UNIVERSE_BUNDLER_NAME }}.exe" | |
| Write-Host " - Status: $($Signature.Status)" | |
| Write-Host " - Status Message: $($Signature.StatusMessage)" | |
| Write-Host " - Signer: $($Signature.SignerCertificate.Subject)" | |
| Write-Host " - Issuer: $($Signature.SignerCertificate.Issuer)" | |
| Write-Host "---------------------------------------------" | |
| & $signtoolPath verify /pa "${{ env.TARI_UNIVERSE_BUNDLER_NAME }}.exe" | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Error "!! Signature verification failed for ${{ env.TARI_UNIVERSE_BUNDLER_NAME }}.exe !!" | |
| exit 1 | |
| } | |
| - name: Add bundled Windows installer to release | |
| if: ${{ startsWith(runner.os,'Windows') && startsWith(github.ref, 'refs/heads/release') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| gh release view "v${{ steps.build.outputs.appVersion }}" | |
| cd tari-win-bundler | |
| ls -la "${{ env.TARI_UNIVERSE_BUNDLER_NAME }}.exe" | |
| gh release view "v${{ steps.build.outputs.appVersion }}" | |
| gh release upload "v${{ steps.build.outputs.appVersion }}" \ | |
| "${{ env.TARI_UNIVERSE_BUNDLER_NAME }}.exe" | |
| gh release view "v${{ steps.build.outputs.appVersion }}" | |
| - name: BETA Builds bundled Windows installer upload | |
| if: ${{ startsWith(runner.os,'Windows') && ( ! startsWith(github.ref, 'refs/heads/release') ) }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: tari-universe-beta_${{ steps.build.outputs.appVersion }}_x64_en-US | |
| path: ./tari-win-bundler/${{ env.TARI_UNIVERSE_BUNDLER_NAME }}*.exe | |
| - name: Locate artifacts path | |
| continue-on-error: true | |
| env: | |
| artifactPaths: ${{ steps.build.outputs.artifactPaths }} | |
| shell: bash | |
| run: | | |
| echo -e "Artifact paths: \n${{ join(fromJSON( env.artifactPaths ), '\n') }}" | |
| MSI_FILE=$( echo '${{ env.artifactPaths }}' | jq -r '[.[] | select(endswith(".msi"))] | join(" ")' ) | |
| echo "MSI_FILE=$MSI_FILE" >> $GITHUB_ENV | |
| - name: BETA Builds - Upload assets | |
| if: ${{ ! startsWith(github.ref, 'refs/heads/release') && github.event_name != 'workflow_dispatch' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: tari-universe-beta_${{ steps.build.outputs.appVersion }}_${{ matrix.platform }}${{ matrix.extra }} | |
| path: "${{ join(fromJSON(steps.build.outputs.artifactPaths), '\n') }}" | |
| - name: Ad-hoc Builds - Upload assets | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: tari-universe-adhoc_${{ steps.build.outputs.appVersion }}_${{ matrix.platform }}${{ matrix.extra }} | |
| path: "${{ join(fromJSON(steps.build.outputs.artifactPaths), '\n') }}" | |
| - name: Windows debug symbols - Upload asset | |
| if: startsWith(runner.os,'Windows') | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: tari_universe.pdb | |
| path: '${{ github.workspace }}/target/release/tari_universe.pdb' | |
| - name: Windows install Sentry CLI | |
| if: ${{ ( startsWith(runner.os,'Windows') ) && ( env.SENTRY_AUTH_TOKEN != '' ) }} | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SYMBOLS_AUTH_TOKEN }} | |
| shell: bash | |
| run: npm install @sentry/cli@2.42.2 -g | |
| - name: Windows debug symbols - Upload to Sentry | |
| if: ${{ ( startsWith(runner.os,'Windows') ) && ( env.SENTRY_AUTH_TOKEN != '' ) }} | |
| continue-on-error: true | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SYMBOLS_AUTH_TOKEN }} | |
| shell: bash | |
| run: | | |
| sentry-cli debug-files check ./target/release/tari_universe.pdb | |
| sentry-cli debug-files upload --org tari-labs --project tari-universe ./target/release/tari_universe.pdb |