diff --git a/.cargo/config.toml b/.cargo/config.toml index b2248b82f0..299ded4740 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,5 @@ # cargo build --all --target=aarch64-unknown-linux-gnu [target.aarch64-unknown-linux-gnu] linker = "aarch64-linux-gnu-gcc" +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000000..914a46fa68 --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,47 @@ +name: Build Docker + +on: + workflow_call: + +jobs: + build-docker-images: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install toml + # Install any other dependencies your script might need + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Determine version + id: version + run: | + if [[ $GITHUB_REF == refs/tags/* ]]; then + echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + else + echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + fi + + - name: Build and Push Docker images + run: python build-tools/docker/build.py --push --docker-hub-user ${{ secrets.DOCKERHUB_USERNAME }} --version ${{ steps.version.outputs.VERSION }} --latest + + env: + DOCKER_BUILDKIT: 1 \ No newline at end of file diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 0000000000..cec31f0043 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,214 @@ +name: Build Linux + +on: + workflow_call: + inputs: + binary_list: + required: true + type: string + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + arch: [aarch64, x86_64] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Extract version from tag + id: get_version + run: | + VERSION=${GITHUB_REF#refs/tags/} + VERSION=${VERSION#v} + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "Version extracted: $VERSION" + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + targets: ${{ matrix.arch }}-unknown-linux-gnu + + - name: Install cross-compilation tools + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + + - name: Install dependencies + run: | + sudo apt-get install -y debhelper zip imagemagick + if [ "${{ matrix.arch }}" = "x86_64" ]; then + sudo apt-get install -y rpm + fi + + - name: Build + run: | + cargo build --release --target ${{ matrix.arch }}-unknown-linux-gnu + + - name: Create Debian package for GUI + run: | + mkdir -p debian-gui/DEBIAN + mkdir -p debian-gui/usr/bin + mkdir -p debian-gui/usr/share/applications + mkdir -p debian-gui/usr/share/icons/hicolor/512x512/apps + mkdir -p debian-gui/usr/share/icons/hicolor/256x256/apps + mkdir -p debian-gui/usr/share/icons/hicolor/128x128/apps + mkdir -p debian-gui/usr/share/icons/hicolor/64x64/apps + cp target/${{ matrix.arch }}-unknown-linux-gnu/release/node-gui debian-gui/usr/bin/ + + # Copy and convert icon files + cp build-tools/assets/node-gui-icon_512.png debian-gui/usr/share/icons/hicolor/512x512/apps/mintlayer-node-gui.png + convert build-tools/assets/node-gui-icon_512.png -resize 256x256 debian-gui/usr/share/icons/hicolor/256x256/apps/mintlayer-node-gui.png + convert build-tools/assets/node-gui-icon_512.png -resize 128x128 debian-gui/usr/share/icons/hicolor/128x128/apps/mintlayer-node-gui.png + convert build-tools/assets/node-gui-icon_512.png -resize 64x64 debian-gui/usr/share/icons/hicolor/64x64/apps/mintlayer-node-gui.png + + # Create .desktop file + cat << EOF > debian-gui/usr/share/applications/mintlayer-node-gui.desktop + [Desktop Entry] + Name=Mintlayer Node GUI + Exec=/usr/bin/node-gui + Icon=mintlayer-node-gui + Type=Application + Categories=Utility;Network; + EOF + + cat << EOF > debian-gui/DEBIAN/control + Package: mintlayer-node-gui + Version: ${{ steps.get_version.outputs.VERSION }} + Section: utils + Priority: optional + Architecture: ${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }} + Maintainer: Mintlayer + Description: Mintlayer Node GUI + A graphical user interface for the Mintlayer node. + EOF + dpkg-deb --build debian-gui + mv debian-gui.deb Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb + + - name: Create Debian package for Node (without GUI) + run: | + mkdir -p debian-node/DEBIAN + mkdir -p debian-node/usr/bin + IFS=',' read -ra BINARIES <<< "${{ inputs.binary_list }}" + for binary in "${BINARIES[@]}"; do + cp target/${{ matrix.arch }}-unknown-linux-gnu/release/$binary debian-node/usr/bin/ + done + cat << EOF > debian-node/DEBIAN/control + Package: mintlayer-node + Version: ${{ steps.get_version.outputs.VERSION }} + Section: utils + Priority: optional + Architecture: ${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }} + Maintainer: Mintlayer + Description: Mintlayer Node + Mintlayer node and associated tools. + EOF + dpkg-deb --build debian-node + mv debian-node.deb Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb + + - name: Create RPM package for GUI + if: matrix.arch == 'x86_64' + run: | + mkdir -p rpm-gui/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + mkdir -p rpm-gui/BUILDROOT/mintlayer-node-gui-${{ steps.get_version.outputs.VERSION }}-1.x86_64 + cp -r debian-gui/usr rpm-gui/BUILDROOT/mintlayer-node-gui-${{ steps.get_version.outputs.VERSION }}-1.x86_64/ + + cat << EOF > rpm-gui/SPECS/mintlayer-node-gui.spec + Name: mintlayer-node-gui + Version: ${{ steps.get_version.outputs.VERSION }} + Release: 1 + Summary: Mintlayer Node GUI + License: MIT + BuildArch: x86_64 + + %description + A graphical user interface for the Mintlayer node. + + %files + /usr/bin/node-gui + /usr/share/applications/mintlayer-node-gui.desktop + /usr/share/icons/hicolor/512x512/apps/mintlayer-node-gui.png + /usr/share/icons/hicolor/256x256/apps/mintlayer-node-gui.png + /usr/share/icons/hicolor/128x128/apps/mintlayer-node-gui.png + /usr/share/icons/hicolor/64x64/apps/mintlayer-node-gui.png + + %changelog + * $(date "+%a %b %d %Y") Mintlayer - ${{ steps.get_version.outputs.VERSION }}-1 + - Initial RPM release + EOF + + rpmbuild -bb --define "_topdir $(pwd)/rpm-gui" --buildroot $(pwd)/rpm-gui/BUILDROOT/mintlayer-node-gui-${{ steps.get_version.outputs.VERSION }}-1.x86_64 rpm-gui/SPECS/mintlayer-node-gui.spec + mv rpm-gui/RPMS/x86_64/mintlayer-node-gui-${{ steps.get_version.outputs.VERSION }}-1.x86_64.rpm Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_x86_64.rpm + + - name: Create RPM package for Node (without GUI) + if: matrix.arch == 'x86_64' + run: | + mkdir -p rpm-node/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + mkdir -p rpm-node/BUILDROOT/mintlayer-node-${{ steps.get_version.outputs.VERSION }}-1.x86_64 + cp -r debian-node/usr rpm-node/BUILDROOT/mintlayer-node-${{ steps.get_version.outputs.VERSION }}-1.x86_64/ + + cat << EOF > rpm-node/SPECS/mintlayer-node.spec + Name: mintlayer-node + Version: ${{ steps.get_version.outputs.VERSION }} + Release: 1 + Summary: Mintlayer Node + License: MIT + BuildArch: x86_64 + + %description + Mintlayer node and associated tools. + + %files + /usr/bin/* + + %changelog + * $(date "+%a %b %d %Y") Mintlayer - ${{ steps.get_version.outputs.VERSION }}-1 + - Initial RPM release + EOF + + rpmbuild -bb --define "_topdir $(pwd)/rpm-node" --buildroot $(pwd)/rpm-node/BUILDROOT/mintlayer-node-${{ steps.get_version.outputs.VERSION }}-1.x86_64 rpm-node/SPECS/mintlayer-node.spec + mv rpm-node/RPMS/x86_64/mintlayer-node-${{ steps.get_version.outputs.VERSION }}-1.x86_64.rpm Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_x86_64.rpm + + - name: Package Mintlayer Node (without GUI) as ZIP + run: | + mkdir -p Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }} + IFS=',' read -ra BINARIES <<< "${{ inputs.binary_list }}" + for binary in "${BINARIES[@]}"; do + cp target/${{ matrix.arch }}-unknown-linux-gnu/release/$binary Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}/ + done + zip -r Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.zip Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }} + + - name: Upload GUI DEB Artifact + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_deb + path: Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb + + - name: Upload Node DEB Artifact (without GUI) + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_deb + path: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb + + - name: Upload GUI RPM Artifact + if: matrix.arch == 'x86_64' + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_x86_64_rpm + path: Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_x86_64.rpm + + - name: Upload Node RPM Artifact (without GUI) + if: matrix.arch == 'x86_64' + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_x86_64_rpm + path: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_x86_64.rpm + + - name: Upload Node ZIP Artifact (without GUI) + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_zip + path: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.zip \ No newline at end of file diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml new file mode 100644 index 0000000000..1a57394ebf --- /dev/null +++ b/.github/workflows/build-macos.yml @@ -0,0 +1,70 @@ +name: Build macOS + +on: + workflow_call: + inputs: + binary_list: + required: true + type: string + +jobs: + build: + runs-on: macos-12 + strategy: + matrix: + arch: [aarch64, x86_64] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Extract version from tag + id: get_version + run: | + VERSION=${GITHUB_REF#refs/tags/} + VERSION=${VERSION#v} + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "Version extracted: $VERSION" + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + targets: ${{ matrix.arch }}-apple-darwin + + - name: Build + run: | + cargo build --release --target ${{ matrix.arch }}-apple-darwin + + - name: Sign and Notarize GUI + env: + MACOS_CERTIFICATE_BASE64: ${{ secrets.MACOS_CERTIFICATE }} + MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} + MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + VERSION: ${{ steps.get_version.outputs.VERSION }} + run: | + ./build-tools/osx/sign_and_notarize.sh ${{ matrix.arch }} ${{ steps.get_version.outputs.VERSION }} + + - name: Package Mintlayer Node (without GUI) + run: | + mkdir -p Mintlayer_Node_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }} + IFS=',' read -ra BINARIES <<< "${{ inputs.binary_list }}" + for binary in "${BINARIES[@]}"; do + cp target/${{ matrix.arch }}-apple-darwin/release/$binary Mintlayer_Node_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}/ + done + zip -r Mintlayer_Node_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.zip Mintlayer_Node_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }} + + - name: Upload DMG Artifact (GUI) + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_GUI_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }} + path: Mintlayer_Node_GUI_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.dmg + + - name: Upload Node Artifact (without GUI) + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }} + path: Mintlayer_Node_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.zip \ No newline at end of file diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 0000000000..bffffc908f --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,114 @@ +name: Build Windows + +on: + workflow_call: + inputs: + binary_list: + required: true + type: string + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Extract version from tag + id: get_version + run: | + $VERSION = $env:GITHUB_REF -replace 'refs/tags/', '' -replace '^v', '' + echo "VERSION=$VERSION" >> $env:GITHUB_OUTPUT + echo "Version extracted: $VERSION" + shell: pwsh + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + + - name: Build Mintlayer Node and GUI + run: cargo build --release + + - name: Package Mintlayer Node + run: | + $VERSION = "${{ steps.get_version.outputs.VERSION }}" + $DEST = "Mintlayer_Node_win_${VERSION}" + New-Item -ItemType Directory -Path $DEST + + $binary_list = "${{ inputs.binary_list }}" -split ',' | Where-Object { $_ -ne "node-gui" } + foreach ($binary in $binary_list) { + $binary = $binary.Trim() + if (Test-Path "target\release\$binary.exe") { + Copy-Item "target\release\$binary.exe" -Destination $DEST + } else { + Write-Warning "Binary not found: $binary.exe" + } + } + + Compress-Archive -Path $DEST -DestinationPath "${DEST}.zip" + shell: pwsh + + - name: Package Mintlayer Node GUI + run: | + $VERSION = "${{ steps.get_version.outputs.VERSION }}" + $DEST = "Mintlayer_Node_GUI_win_${VERSION}" + New-Item -ItemType Directory -Path $DEST + Copy-Item "target\release\node-gui.exe" -Destination $DEST + Compress-Archive -Path $DEST -DestinationPath "${DEST}.zip" + shell: pwsh + + - name: Upload Node ZIP Artifact + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_win_${{ steps.get_version.outputs.VERSION }} + path: Mintlayer_Node_win_${{ steps.get_version.outputs.VERSION }}.zip + + - name: Upload GUI ZIP Artifact + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }} + path: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}.zip + + - name: Install NSIS + run: | + choco install nsis -y + echo "C:\Program Files (x86)\NSIS" >> $env:GITHUB_PATH + shell: pwsh + + - name: Create NSIS Installer Script + run: | + $VERSION = "${{ steps.get_version.outputs.VERSION }}" + $NSIS_SCRIPT = @" + !include "MUI2.nsh" + Name "Mintlayer Node GUI" + OutFile "Mintlayer_Node_GUI_win_${VERSION}_Setup.exe" + InstallDir "$PROGRAMFILES64\Mintlayer Node GUI" + !insertmacro MUI_PAGE_DIRECTORY + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_LANGUAGE "English" + Section "Install" + SetOutPath "$INSTDIR" + File "target\release\node-gui.exe" + CreateShortCut "$DESKTOP\Mintlayer Node GUI.lnk" "$INSTDIR\node-gui.exe" + WriteUninstaller "$INSTDIR\uninstall.exe" + SectionEnd + Section "Uninstall" + Delete "$INSTDIR\node-gui.exe" + Delete "$INSTDIR\uninstall.exe" + Delete "$DESKTOP\Mintlayer Node GUI.lnk" + RMDir "$INSTDIR" + SectionEnd + "@ + $NSIS_SCRIPT | Out-File -FilePath "installer.nsi" -Encoding utf8 + shell: pwsh + + - name: Build NSIS Installer + run: makensis installer.nsi + + - name: Upload NSIS Installer Artifact + uses: actions/upload-artifact@v4 + with: + name: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}_Setup + path: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}_Setup.exe \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e7d57da35..d2785476a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: run: cargo test --release test_4opc_sequences -- --ignored - name: Run functional tests run: cargo test --release -p mintlayer-test --test functional -- --ignored - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: failure() with: name: windows-functional-test-artifacts @@ -78,7 +78,7 @@ jobs: run: cargo test --release test_4opc_sequences - name: Run functional tests run: cargo test --release -p mintlayer-test --test functional -- --ignored - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: failure() with: name: ubuntu-functional-test-artifacts @@ -110,7 +110,7 @@ jobs: run: cargo test --release test_4opc_sequences - name: Run functional tests run: cargo test --release -p mintlayer-test --test functional -- --ignored - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: failure() with: name: macos-functional-test-artifacts diff --git a/.github/workflows/coverage.yml.disabled b/.github/workflows/coverage.yml.disabled index 17a4e7cd4a..d0cde48640 100644 --- a/.github/workflows/coverage.yml.disabled +++ b/.github/workflows/coverage.yml.disabled @@ -70,7 +70,7 @@ # - name: Collect coverage data with grcov # run: grcov . --source-dir . --output-type lcov --branch --ignore-not-existing --binary-path ./target/debug/ -o grcov-report-${{ matrix.partition }} -# - uses: actions/upload-artifact@v2 +# - uses: actions/upload-artifact@v4 # with: # name: code-coverage-report-${{ matrix.partition }} # path: grcov-report-${{ matrix.partition }} diff --git a/.github/workflows/mac_release.yml b/.github/workflows/mac_release.yml deleted file mode 100644 index 6e4bfeb5ca..0000000000 --- a/.github/workflows/mac_release.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: macOS Build and Package - -on: - push: - tags: - - '**[0-9]+.[0-9]+.[0-9]+*' - pull_request: - - -jobs: - build: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Build Release - run: cargo build --release - - - name: Install create-dmg - run: brew install create-dmg - - - name: Create App Bundle - run: | - mkdir -p target/${{ matrix.target }}/bundle/osx/Mintlayer\ Node\ GUI.app/Contents/MacOS - mkdir -p target/${{ matrix.target }}/bundle/osx/Mintlayer\ Node\ GUI.app/Contents/Resources - cp target/${{ matrix.target }}/node-gui target/${{ matrix.target }}/bundle/osx/Mintlayer\ Node\ GUI.app/Contents/MacOS/ - cp logo.icns target/${{ matrix.target }}/bundle/osx/Mintlayer\ Node\ GUI.app/Contents/Resources/ - - - name: Generate Info.plist (macOS only) - run: | - VERSION=$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "node-gui") | .version') - BUILD_NUMBER=$(date +%Y%m%d.%H%M%S) - sed -e "s/VERSION_PLACEHOLDER/$VERSION/g" -e "s/BUILD_PLACEHOLDER/$BUILD_NUMBER/g" build-tools/osx/Info.plist.template > target/${{ matrix.target }}/release/bundle/osx/Mintlayer\ Node\ GUI.app/Contents/Info.plist - - - name: Code Sign - env: - MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} - MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} - run: | - echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 - security create-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain - security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${{ secrets.KEYCHAIN_PASSWORD }}" build.keychain - /usr/bin/codesign --force -s "${{ secrets.CERTIFICATE_NAME }}" --options runtime target/release/bundle/osx/Mintlayer\ Node\ GUI.app -v - - - name: Create DMG - run: | - create-dmg \ - --volname "Mintlayer Node GUI" \ - --window-pos 200 120 \ - --window-size 600 400 \ - --icon-size 100 \ - --icon "Mintlayer Node GUI.app" 175 120 \ - --hide-extension "Mintlayer Node GUI.app" \ - --app-drop-link 425 120 \ - "Mintlayer_Node_GUI.dmg" \ - "target/release/bundle/osx/" - - - name: Upload DMG - uses: actions/upload-artifact@v2 - with: - name: Mintlayer_Node_GUI - path: Mintlayer_Node_GUI.dmg \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d8d1ceb7dc..0821720569 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,297 +1,103 @@ -# Copyright 2022-2023, axodotdev -# SPDX-License-Identifier: MIT or Apache-2.0 -# -# CI that: -# -# * checks for a Git Tag that looks like a release -# * builds artifacts with cargo-dist (archives, installers, hashes) -# * uploads those artifacts to temporary workflow zip -# * on success, uploads the artifacts to a Github Release -# -# Note that the Github Release will be created with a generated -# title/body based on your changelogs. +name: Build, Sign, and Release -name: Release - -permissions: - contents: write - -# This task will run whenever you push a git tag that looks like a version -# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc. -# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where -# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION -# must be a Cargo-style SemVer Version (must have at least major.minor.patch). -# -# If PACKAGE_NAME is specified, then the announcement will be for that -# package (erroring out if it doesn't have the given version or isn't cargo-dist-able). -# -# If PACKAGE_NAME isn't specified, then the announcement will be for all -# (cargo-dist-able) packages in the workspace with that version (this mode is -# intended for workspaces with only one dist-able package, or with all dist-able -# packages versioned/released in lockstep). -# -# If you push multiple tags at once, separate instances of this workflow will -# spin up, creating an independent announcement for each one. However Github -# will hard limit this to 3 tags per commit, as it will assume more tags is a -# mistake. -# -# If there's a prerelease-style suffix to the version, then the release(s) -# will be marked as a prerelease. on: push: tags: - '**[0-9]+.[0-9]+.[0-9]+*' pull_request: - + jobs: - # Run 'cargo dist plan' (or host) to determine what tasks we need to do - plan: - runs-on: ubuntu-latest - outputs: - val: ${{ steps.plan.outputs.manifest }} - tag: ${{ !github.event.pull_request && github.ref_name || '' }} - tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }} - publishing: ${{ !github.event.pull_request }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install cargo-dist - # we specify bash to get pipefail; it guards against the `curl` command - # failing. otherwise `sh` won't catch that `curl` returned non-0 - shell: bash - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.0/cargo-dist-installer.sh | sh" - # sure would be cool if github gave us proper conditionals... - # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible - # functionality based on whether this is a pull_request, and whether it's from a fork. - # (PRs run on the *source* but secrets are usually on the *target* -- that's *good* - # but also really annoying to build CI around when it needs secrets to work right.) - - id: plan - run: | - cargo dist ${{ !github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name) || (github.event.pull_request.head.repo.fork && 'plan' || 'host --steps=check') }} --output-format=json > dist-manifest.json - echo "cargo dist ran successfully" - cat dist-manifest.json - echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" - - name: "Upload dist-manifest.json" - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: dist-manifest.json + build-macos: + uses: ./.github/workflows/build-macos.yml + with: + binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon + secrets: inherit - # Build and packages all the platform-specific things - build-local-artifacts: - name: build-local-artifacts (${{ join(matrix.targets, ', ') }}) - # Let the initial task tell us to not run (currently very blunt) - needs: - - plan - if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }} - strategy: - fail-fast: false - # Target platforms/runners are computed by cargo-dist in create-release. - # Each member of the matrix has the following arguments: - # - # - runner: the github runner - # - dist-args: cli flags to pass to cargo dist - # - install-dist: expression to run to install cargo-dist on the runner - # - # Typically there will be: - # - 1 "global" task that builds universal installers - # - N "local" tasks that build each platform's binaries and platform-specific installers - matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }} - runs-on: ${{ matrix.runner }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - uses: swatinem/rust-cache@v2 - - name: Install cargo-dist - run: ${{ matrix.install_dist }} - # Get the dist-manifest - - name: Fetch local artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts - path: target/distrib/ - - name: Install dependencies - run: | - ${{ matrix.packages_install }} - - name: Build artifacts - run: | - # Actually do builds and make zips and whatnot - cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json - echo "cargo dist ran successfully" - - id: cargo-dist - name: Post-build - # We force bash here just because github makes it really hard to get values up - # to "real" actions without writing to env-vars, and writing to env-vars has - # inconsistent syntax between shell and powershell. - shell: bash - run: | - # Parse out what we just built and upload it to scratch storage - echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" - echo "EOF" >> "$GITHUB_OUTPUT" + build-linux: + uses: ./.github/workflows/build-linux.yml + with: + binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon + secrets: inherit - cp dist-manifest.json "$BUILD_MANIFEST_NAME" - - name: "Upload artifacts" - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: | - ${{ steps.cargo-dist.outputs.paths }} - ${{ env.BUILD_MANIFEST_NAME }} + build-windows: + uses: ./.github/workflows/build-windows.yml + with: + binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon + secrets: inherit - # Build and package all the platform-agnostic(ish) things - build-global-artifacts: - needs: - - plan - - build-local-artifacts - runs-on: "ubuntu-20.04" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json + build-docker: + uses: ./.github/workflows/build-docker.yml + secrets: inherit + + create-release: + needs: [build-macos, build-linux, build-windows] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.0/cargo-dist-installer.sh | sh" - # Get all the local artifacts for the global tasks to use (for e.g. checksums) - - name: Fetch local artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts - path: target/distrib/ - - id: cargo-dist - shell: bash - run: | - cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json - echo "cargo dist ran successfully" + - uses: actions/checkout@v4 - # Parse out what we just built and upload it to scratch storage - echo "paths<> "$GITHUB_OUTPUT" - jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json >> "$GITHUB_OUTPUT" - echo "EOF" >> "$GITHUB_OUTPUT" + - name: Extract version from tag + id: get_version + run: | + VERSION=${GITHUB_REF#refs/tags/} + VERSION=${VERSION#v} + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - cp dist-manifest.json "$BUILD_MANIFEST_NAME" - - name: "Upload artifacts" - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: | - ${{ steps.cargo-dist.outputs.paths }} - ${{ env.BUILD_MANIFEST_NAME }} - # Determines if we should publish/announce - host: - needs: - - plan - - build-local-artifacts - - build-global-artifacts - # Only run if we're "publishing", and only if local and global didn't fail (skipped is fine) - if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - runs-on: "ubuntu-20.04" - outputs: - val: ${{ steps.host.outputs.manifest }} - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install cargo-dist - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.0/cargo-dist-installer.sh | sh" - # Fetch artifacts from scratch-storage - - name: Fetch artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts - path: target/distrib/ - # This is a harmless no-op for Github Releases, hosting for that happens in "announce" - - id: host - shell: bash - run: | - cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json - echo "artifacts uploaded and released successfully" - cat dist-manifest.json - echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" - - name: "Upload dist-manifest.json" - uses: actions/upload-artifact@v3 - with: - name: artifacts - path: dist-manifest.json + - name: Download Artifacts + uses: actions/download-artifact@v4 - publish-homebrew-formula: - needs: - - plan - - host - runs-on: "ubuntu-20.04" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PLAN: ${{ needs.plan.outputs.val }} - GITHUB_USER: "axo bot" - GITHUB_EMAIL: "admin+bot@axo.dev" - if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }} - steps: - - uses: actions/checkout@v4 - with: - repository: "mintlayer/homebrew" - token: ${{ secrets.HOMEBREW_TAP_TOKEN }} - # So we have access to the formula - - name: Fetch local artifacts - uses: actions/download-artifact@v3 - with: - name: artifacts - path: Formula/ - - name: Commit formula files - run: | - git config --global user.name "${GITHUB_USER}" - git config --global user.email "${GITHUB_EMAIL}" + - name: Generate Hashes + id: generate_hashes + run: | + echo "HASHES<> $GITHUB_OUTPUT + for file in Mintlayer_Node_*/*.dmg Mintlayer_Node_*/*.deb Mintlayer_Node_*/*.rpm Mintlayer_Node_*/*.zip Mintlayer_Node_*/*_Setup.exe; do + if [ -f "$file" ]; then + echo "$(sha256sum $file | awk '{print $1}') $(basename $file)" >> $GITHUB_OUTPUT + fi + done + echo "EOF" >> $GITHUB_OUTPUT - for release in $(echo "$PLAN" | jq --compact-output '.releases[]'); do - name=$(echo "$release" | jq .app_name --raw-output) - version=$(echo "$release" | jq .app_version --raw-output) + - name: Generate Release Body + id: generate_body + run: | + echo "BODY<> $GITHUB_OUTPUT + echo "Release version ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "This release includes the following packages:" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "macOS:" >> $GITHUB_OUTPUT + echo "- Mintlayer Node GUI (DMG) for Intel and Apple Silicon" >> $GITHUB_OUTPUT + echo "- Mintlayer Node (ZIP) for Intel and Apple Silicon" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "Linux:" >> $GITHUB_OUTPUT + echo "- Mintlayer Node GUI (DEB) for x86_64 and ARM64" >> $GITHUB_OUTPUT + echo "- Mintlayer Node (DEB and ZIP) for x86_64 and ARM64" >> $GITHUB_OUTPUT + echo "- Mintlayer Node GUI (RPM) for x86_64" >> $GITHUB_OUTPUT + echo "- Mintlayer Node (RPM) for x86_64" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "Windows:" >> $GITHUB_OUTPUT + echo "- Mintlayer Node GUI (ZIP) for x64" >> $GITHUB_OUTPUT + echo "- Mintlayer Node GUI Installer (EXE) for x64" >> $GITHUB_OUTPUT + echo "- Mintlayer Node (ZIP) for x86" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "Please download the appropriate package for your system." >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "Docker Images" >> $GITHUB_OUTPUT + echo "Find docker images in the docker hub:" >> $GITHUB_OUTPUT + echo "https://hub.docker.com/u/mintlayer" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "File Hashes (SHA256):" >> $GITHUB_OUTPUT + echo "\`\`\`" >> $GITHUB_OUTPUT + echo "${{ steps.generate_hashes.outputs.HASHES }}" >> $GITHUB_OUTPUT + echo "\`\`\`" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - git add Formula/${name}.rb - git commit -m "${name} ${version}" - done - git push - - # Create a Github Release while uploading all files to it - announce: - needs: - - plan - - host - - publish-homebrew-formula - # use "always() && ..." to allow us to wait for all publish jobs while - # still allowing individual publish jobs to skip themselves (for prereleases). - # "host" however must run to completion, no skipping allowed! - if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }} - runs-on: "ubuntu-20.04" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: "Download Github Artifacts" - uses: actions/download-artifact@v3 - with: - name: artifacts - path: artifacts - - name: Cleanup - run: | - # Remove the granular manifests - rm -f artifacts/*-dist-manifest.json - - name: Create Github Release - uses: ncipollo/release-action@v1 - with: - tag: ${{ needs.plan.outputs.tag }} - name: ${{ fromJson(needs.host.outputs.val).announcement_title }} - body: ${{ fromJson(needs.host.outputs.val).announcement_github_body }} - prerelease: ${{ fromJson(needs.host.outputs.val).announcement_is_prerelease }} - artifacts: "artifacts/*" + - name: Create Release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: "Mintlayer_Node_*/*.dmg,Mintlayer_Node_*/*.deb,Mintlayer_Node_*/*.rpm,Mintlayer_Node_*/*.zip,Mintlayer_Node_*/*_Setup.exe" + artifactErrorsFailBuild: true + name: "Release ${{ steps.get_version.outputs.VERSION }}" + body: ${{ steps.generate_body.outputs.BODY }} + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index e0f99e2a22..43b8733718 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -82,7 +82,7 @@ jobs: run: cp README.md wasm-wrappers-builds/ && cp WASM-API.md wasm-wrappers-builds/ - name: Create artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: wasm_builds path: | diff --git a/.gitignore b/.gitignore index c62ff75a18..34b6f83fdd 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,9 @@ #exclude python env env/ +#exclude env +.env + # Test Python cache test/**/__pycache__ diff --git a/Cargo.lock b/Cargo.lock index 28fd4f47c9..0e02c4fdd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,7 +20,7 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "accounting" -version = "0.5.1" +version = "0.99.0" dependencies = [ "common", "parity-scale-codec", @@ -247,7 +247,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "api-blockchain-scanner-daemon" -version = "0.5.1" +version = "0.99.0" dependencies = [ "api-blockchain-scanner-lib", "api-server-common", @@ -265,7 +265,7 @@ dependencies = [ [[package]] name = "api-blockchain-scanner-lib" -version = "0.5.1" +version = "0.99.0" dependencies = [ "api-server-common", "async-trait", @@ -293,7 +293,7 @@ dependencies = [ [[package]] name = "api-server-backend-test-suite" -version = "0.5.1" +version = "0.99.0" dependencies = [ "api-server-common", "async-trait", @@ -316,7 +316,7 @@ dependencies = [ [[package]] name = "api-server-common" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "bb8-postgres", @@ -340,7 +340,7 @@ dependencies = [ [[package]] name = "api-server-stack-test-suite" -version = "0.5.1" +version = "0.99.0" dependencies = [ "api-blockchain-scanner-lib", "api-server-common", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "api-web-server" -version = "0.5.1" +version = "0.99.0" dependencies = [ "api-server-common", "async-trait", @@ -905,7 +905,7 @@ dependencies = [ [[package]] name = "blockprod" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "chainstate", @@ -1179,7 +1179,7 @@ dependencies = [ [[package]] name = "chainstate" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "async-trait", @@ -1224,7 +1224,7 @@ dependencies = [ [[package]] name = "chainstate-launcher" -version = "0.5.1" +version = "0.99.0" dependencies = [ "chainstate", "chainstate-storage", @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "chainstate-storage" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "chainstate-types", @@ -1265,7 +1265,7 @@ dependencies = [ [[package]] name = "chainstate-test-framework" -version = "0.5.1" +version = "0.99.0" dependencies = [ "chainstate", "chainstate-storage", @@ -1294,7 +1294,7 @@ dependencies = [ [[package]] name = "chainstate-test-suite" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "chainstate", @@ -1326,7 +1326,7 @@ dependencies = [ [[package]] name = "chainstate-types" -version = "0.5.1" +version = "0.99.0" dependencies = [ "common", "crypto", @@ -1535,7 +1535,7 @@ dependencies = [ [[package]] name = "common" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "bech32 0.11.0", @@ -1589,7 +1589,7 @@ dependencies = [ [[package]] name = "consensus" -version = "0.5.1" +version = "0.99.0" dependencies = [ "chainstate-types", "common", @@ -1610,7 +1610,7 @@ dependencies = [ [[package]] name = "constraints-value-accumulator" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "common", @@ -1837,7 +1837,7 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto" -version = "0.5.1" +version = "0.99.0" dependencies = [ "argon2", "bip39", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "dns-server" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "async-trait", @@ -3934,7 +3934,7 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "log_error" -version = "0.5.1" +version = "0.99.0" dependencies = [ "derive_more", "logging", @@ -3947,7 +3947,7 @@ dependencies = [ [[package]] name = "logging" -version = "0.5.1" +version = "0.99.0" dependencies = [ "log", "thiserror", @@ -4099,7 +4099,7 @@ dependencies = [ [[package]] name = "mempool" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "anyhow", @@ -4141,7 +4141,7 @@ dependencies = [ [[package]] name = "mempool-types" -version = "0.5.1" +version = "0.99.0" dependencies = [ "p2p-types", "rpc-description", @@ -4213,7 +4213,7 @@ dependencies = [ [[package]] name = "mintlayer-core" -version = "0.5.1" +version = "0.99.0" dependencies = [ "chainstate", "chainstate-storage", @@ -4232,7 +4232,7 @@ dependencies = [ [[package]] name = "mintlayer-test" -version = "0.5.1" +version = "0.99.0" dependencies = [ "clap", "libtest-mimic", @@ -4248,7 +4248,7 @@ dependencies = [ [[package]] name = "mintscript" -version = "0.5.1" +version = "0.99.0" dependencies = [ "common", "crypto", @@ -4319,7 +4319,7 @@ dependencies = [ [[package]] name = "mocks" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "chainstate", @@ -4406,7 +4406,7 @@ dependencies = [ [[package]] name = "networking" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "bytes", @@ -4453,7 +4453,7 @@ dependencies = [ [[package]] name = "node-comm" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "base64 0.22.1", @@ -4480,7 +4480,7 @@ dependencies = [ [[package]] name = "node-daemon" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "assert_cmd", @@ -4494,7 +4494,7 @@ dependencies = [ [[package]] name = "node-gui" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "chainstate", @@ -4526,7 +4526,7 @@ dependencies = [ [[package]] name = "node-lib" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "blockprod", @@ -4964,7 +4964,7 @@ dependencies = [ [[package]] name = "orders-accounting" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "chainstate-types", @@ -5023,7 +5023,7 @@ dependencies = [ [[package]] name = "p2p" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "chainstate", @@ -5074,7 +5074,7 @@ dependencies = [ [[package]] name = "p2p-backend-test-suite" -version = "0.5.1" +version = "0.99.0" dependencies = [ "chainstate", "common", @@ -5094,7 +5094,7 @@ dependencies = [ [[package]] name = "p2p-test-utils" -version = "0.5.1" +version = "0.99.0" dependencies = [ "chainstate", "chainstate-storage", @@ -5114,7 +5114,7 @@ dependencies = [ [[package]] name = "p2p-types" -version = "0.5.1" +version = "0.99.0" dependencies = [ "common", "parity-scale-codec", @@ -5428,7 +5428,7 @@ dependencies = [ [[package]] name = "pos-accounting" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "common", @@ -5800,7 +5800,7 @@ dependencies = [ [[package]] name = "randomness" -version = "0.5.1" +version = "0.99.0" dependencies = [ "rand 0.8.5", ] @@ -6151,7 +6151,7 @@ checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rpc" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "async-trait", @@ -6181,7 +6181,7 @@ dependencies = [ [[package]] name = "rpc-description" -version = "0.5.1" +version = "0.99.0" dependencies = [ "rpc-description-macro", "serde_json", @@ -6189,7 +6189,7 @@ dependencies = [ [[package]] name = "rpc-description-macro" -version = "0.5.1" +version = "0.99.0" dependencies = [ "proc-macro2", "quote", @@ -6198,7 +6198,7 @@ dependencies = [ [[package]] name = "rpc-types" -version = "0.5.1" +version = "0.99.0" dependencies = [ "hex", "rpc-description", @@ -6507,7 +6507,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "script" -version = "0.5.1" +version = "0.99.0" dependencies = [ "crypto", "flate2", @@ -6762,7 +6762,7 @@ dependencies = [ [[package]] name = "serialization" -version = "0.5.1" +version = "0.99.0" dependencies = [ "hex", "rpc-description", @@ -6775,7 +6775,7 @@ dependencies = [ [[package]] name = "serialization-core" -version = "0.5.1" +version = "0.99.0" dependencies = [ "arraytools", "hex-literal", @@ -6785,7 +6785,7 @@ dependencies = [ [[package]] name = "serialization-tagged" -version = "0.5.1" +version = "0.99.0" dependencies = [ "parity-scale-codec", "proptest", @@ -6797,7 +6797,7 @@ dependencies = [ [[package]] name = "serialization-tagged-derive" -version = "0.5.1" +version = "0.99.0" dependencies = [ "itertools 0.13.0", "proc-macro2", @@ -7157,7 +7157,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "storage" -version = "0.5.1" +version = "0.99.0" dependencies = [ "common", "rstest", @@ -7170,7 +7170,7 @@ dependencies = [ [[package]] name = "storage-backend-test-suite" -version = "0.5.1" +version = "0.99.0" dependencies = [ "libtest-mimic", "logging", @@ -7185,7 +7185,7 @@ dependencies = [ [[package]] name = "storage-core" -version = "0.5.1" +version = "0.99.0" dependencies = [ "common", "itertools 0.13.0", @@ -7198,7 +7198,7 @@ dependencies = [ [[package]] name = "storage-failing" -version = "0.5.1" +version = "0.99.0" dependencies = [ "enumflags2", "storage", @@ -7210,7 +7210,7 @@ dependencies = [ [[package]] name = "storage-inmemory" -version = "0.5.1" +version = "0.99.0" dependencies = [ "storage-backend-test-suite", "storage-core", @@ -7219,7 +7219,7 @@ dependencies = [ [[package]] name = "storage-lmdb" -version = "0.5.1" +version = "0.99.0" dependencies = [ "lmdb-mintlayer", "logging", @@ -7233,7 +7233,7 @@ dependencies = [ [[package]] name = "storage-sqlite" -version = "0.5.1" +version = "0.99.0" dependencies = [ "hex", "logging", @@ -7297,7 +7297,7 @@ dependencies = [ [[package]] name = "subsystem" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "cfg-if", @@ -7458,7 +7458,7 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test-rpc-functions" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "chainstate", @@ -7480,7 +7480,7 @@ dependencies = [ [[package]] name = "test-utils" -version = "0.5.1" +version = "0.99.0" dependencies = [ "common", "crypto", @@ -7642,7 +7642,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokens-accounting" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "chainstate-types", @@ -8085,7 +8085,7 @@ checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" [[package]] name = "tx-verifier" -version = "0.5.1" +version = "0.99.0" dependencies = [ "accounting", "chainstate-storage", @@ -8115,14 +8115,14 @@ dependencies = [ [[package]] name = "typename" -version = "0.5.1" +version = "0.99.0" dependencies = [ "typename-derive", ] [[package]] name = "typename-derive" -version = "0.5.1" +version = "0.99.0" dependencies = [ "itertools 0.13.0", "quote", @@ -8269,7 +8269,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utils" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "clap", @@ -8300,7 +8300,7 @@ dependencies = [ [[package]] name = "utils-networking" -version = "0.5.1" +version = "0.99.0" dependencies = [ "addr", "itertools 0.13.0", @@ -8314,7 +8314,7 @@ dependencies = [ [[package]] name = "utxo" -version = "0.5.1" +version = "0.99.0" dependencies = [ "chainstate-types", "common", @@ -8404,7 +8404,7 @@ dependencies = [ [[package]] name = "wallet" -version = "0.5.1" +version = "0.99.0" dependencies = [ "bip39", "chainstate", @@ -8437,7 +8437,7 @@ dependencies = [ [[package]] name = "wallet-address-generator" -version = "0.5.1" +version = "0.99.0" dependencies = [ "clap", "common", @@ -8452,7 +8452,7 @@ dependencies = [ [[package]] name = "wallet-address-generator-lib" -version = "0.5.1" +version = "0.99.0" dependencies = [ "clap", "common", @@ -8466,7 +8466,7 @@ dependencies = [ [[package]] name = "wallet-cli" -version = "0.5.1" +version = "0.99.0" dependencies = [ "clap", "tokio", @@ -8476,7 +8476,7 @@ dependencies = [ [[package]] name = "wallet-cli-commands" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "blockprod", @@ -8523,7 +8523,7 @@ dependencies = [ [[package]] name = "wallet-cli-lib" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "blockprod", @@ -8570,7 +8570,7 @@ dependencies = [ [[package]] name = "wallet-controller" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "async-trait", @@ -8606,7 +8606,7 @@ dependencies = [ [[package]] name = "wallet-rpc-client" -version = "0.5.1" +version = "0.99.0" dependencies = [ "async-trait", "base64 0.22.1", @@ -8635,7 +8635,7 @@ dependencies = [ [[package]] name = "wallet-rpc-daemon" -version = "0.5.1" +version = "0.99.0" dependencies = [ "clap", "common", @@ -8651,7 +8651,7 @@ dependencies = [ [[package]] name = "wallet-rpc-lib" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "async-trait", @@ -8690,7 +8690,7 @@ dependencies = [ [[package]] name = "wallet-storage" -version = "0.5.1" +version = "0.99.0" dependencies = [ "bip39", "common", @@ -8709,7 +8709,7 @@ dependencies = [ [[package]] name = "wallet-test-node" -version = "0.5.1" +version = "0.99.0" dependencies = [ "blockprod", "chainstate", @@ -8730,7 +8730,7 @@ dependencies = [ [[package]] name = "wallet-types" -version = "0.5.1" +version = "0.99.0" dependencies = [ "bip39", "common", @@ -8846,7 +8846,7 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-doc-gen" -version = "0.5.1" +version = "0.99.0" dependencies = [ "anyhow", "clap", @@ -8870,7 +8870,7 @@ dependencies = [ [[package]] name = "wasm-wrappers" -version = "0.5.1" +version = "0.99.0" dependencies = [ "bip39", "common", diff --git a/Cargo.toml b/Cargo.toml index 8f62a30467..dc254e4a95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ homepage = "https://mintlayer.org" repository = "https://github.com/mintlayer/mintlayer-core" readme = "README.md" license = "MIT" -version = "0.5.1" +version = "0.99.0" authors = [ "Samer Afach ", "Ben Marsh ", @@ -129,7 +129,7 @@ utxo = { path = "utxo" } [workspace.package] edition = "2021" rust-version = "1.80" -version = "0.5.1" +version = "0.99.0" license = "MIT" [workspace.dependencies] @@ -247,26 +247,6 @@ trust-dns-server = "0.23" variant_count = "1.1" zeroize = "1.5" -# Config for 'cargo dist' -[workspace.metadata.dist] -# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.8.0" -# CI backends to support -ci = ["github"] -# The installers to generate for each app -installers = ["shell", "powershell", "homebrew"] -# Target platforms to build apps for (Rust target-triple syntax) -targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"] -# Extra static files to include in each App (path relative to this Cargo.toml's dir) -include = ["Mintlayer_Node_GUI.dmg"] -additional-files = ["Mintlayer_Node_GUI.dmg"] -# Publish jobs to run in CI -pr-run-mode = "plan" -# A GitHub repo to push Homebrew formulas to -tap = "mintlayer/homebrew" -# Publish jobs to run in CI -publish-jobs = ["homebrew"] - [workspace.metadata.dist.dependencies.apt] "libatk1.0-0" = "*" "libatk1.0-dev" = "*" @@ -297,8 +277,3 @@ overflow-checks = true [profile.test.package.script] opt-level = 2 - -# The profile that 'cargo dist' will build with -[profile.dist] -inherits = "release" -lto = "off" diff --git a/api-server/scanner-daemon/Cargo.toml b/api-server/scanner-daemon/Cargo.toml index ddda67d013..d2a31bd9f2 100644 --- a/api-server/scanner-daemon/Cargo.toml +++ b/api-server/scanner-daemon/Cargo.toml @@ -4,13 +4,11 @@ edition.workspace = true rust-version.workspace = true version.workspace = true license.workspace = true -authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] - -[package.metadata.wix] -upgrade-guid = "F865FB32-5DFE-40BA-8D18-929BFB574D3F" -path-guid = "299449A6-D768-4D78-A28B-66B607827CA9" -license = false -eula = false +authors = [ + "Samer Afach ", + "Ben Marsh ", + "Enrico Rubboli ", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/api-server/web-server/Cargo.toml b/api-server/web-server/Cargo.toml index a22ae78199..26666a0450 100644 --- a/api-server/web-server/Cargo.toml +++ b/api-server/web-server/Cargo.toml @@ -4,13 +4,11 @@ edition.workspace = true rust-version.workspace = true version.workspace = true license.workspace = true -authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] - -[package.metadata.wix] -upgrade-guid = "1F0D44A3-01B0-4A9A-A4E4-BC4B2B505EE9" -path-guid = "38D4CC73-6E48-4C0C-B705-1D1CD371ED31" -license = false -eula = false +authors = [ + "Samer Afach ", + "Ben Marsh ", + "Enrico Rubboli ", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/build-tools/assets/logo.icns b/build-tools/assets/logo.icns new file mode 100644 index 0000000000..50587c1054 Binary files /dev/null and b/build-tools/assets/logo.icns differ diff --git a/build-tools/assets/logo.ico b/build-tools/assets/logo.ico new file mode 100644 index 0000000000..48fd184076 Binary files /dev/null and b/build-tools/assets/logo.ico differ diff --git a/build-tools/assets/node-gui-icon_512.png b/build-tools/assets/node-gui-icon_512.png new file mode 100644 index 0000000000..3a00b78264 Binary files /dev/null and b/build-tools/assets/node-gui-icon_512.png differ diff --git a/build-tools/codecheck/codecheck.py b/build-tools/codecheck/codecheck.py index a372b7aa90..dcd6b4318c 100755 --- a/build-tools/codecheck/codecheck.py +++ b/build-tools/codecheck/codecheck.py @@ -350,6 +350,7 @@ def check_trailing_whitespaces(): 'script/src/test/test_vectors_4opc.csv.gz', 'wasm-wrappers/pkg/wasm_wrappers_bg.wasm', 'wasm-wrappers/doc/*', + 'build-tools/assets/*' ] ok = True diff --git a/build-tools/osx/DeveloperIDG2CA.cer b/build-tools/osx/DeveloperIDG2CA.cer new file mode 100644 index 0000000000..8cbcf6f46c Binary files /dev/null and b/build-tools/osx/DeveloperIDG2CA.cer differ diff --git a/build-tools/osx/Info.plist.template b/build-tools/osx/Info.plist.template index 8e5e66af8a..be5a2a7a40 100644 --- a/build-tools/osx/Info.plist.template +++ b/build-tools/osx/Info.plist.template @@ -6,6 +6,8 @@ English CFBundleDisplayName Mintlayer Node GUI + CFBundleIdentifier + org.mintlayer.mintlayer-core.node-gui CFBundleExecutable node-gui CFBundleIconFile @@ -22,11 +24,15 @@ VERSION_PLACEHOLDER CFBundleVersion BUILD_PLACEHOLDER - CSResourcesFileMapped - - LSRequiresCarbon - + LSMinimumSystemVersion + 10.13 NSHighResolutionCapable + NSSupportsAutomaticGraphicsSwitching + + LSApplicationCategoryType + public.app-category.finance + NSAppleEventsUsageDescription + This app requires access to send Apple Events for automation purposes. \ No newline at end of file diff --git a/build-tools/osx/entitlements.plist b/build-tools/osx/entitlements.plist new file mode 100644 index 0000000000..9c6d9793e3 --- /dev/null +++ b/build-tools/osx/entitlements.plist @@ -0,0 +1,51 @@ + + + + + + com.apple.security.files.user-selected.read-write + + com.apple.security.files.user-selected.read-only + + com.apple.security.files.downloads.read-write + + + + com.apple.security.network.client + + com.apple.security.network.server + + + + com.apple.security.device.audio-input + + com.apple.security.device.camera + + com.apple.security.device.usb + + com.apple.security.device.print + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.disable-library-validation + + + + com.apple.security.get-task-allow + + + + com.apple.security.personal-information.addressbook + + com.apple.security.personal-information.calendars + + com.apple.security.personal-information.location + + + \ No newline at end of file diff --git a/build-tools/osx/sign_and_notarize.sh b/build-tools/osx/sign_and_notarize.sh new file mode 100755 index 0000000000..3edaebeda1 --- /dev/null +++ b/build-tools/osx/sign_and_notarize.sh @@ -0,0 +1,231 @@ +#!/bin/bash + +set -e + +ARCH=$1 +VERSION=$2 + +# Configuration +APP_NAME="Mintlayer Node GUI" +DMG_NAME="Mintlayer_Node_GUI_macos_${VERSION}_${ARCH}.dmg" +KEYCHAIN_NAME="build.keychain" +KEYCHAIN_PASSWORD="temporary_password" +NOTARIZATION_TIMEOUT=60 # Maximum wait time for notarization in seconds + +# Function to display usage information +usage() { + echo "Usage: $0 " + echo " architecture: aarch64 or x86_64" + echo " version: in the format x.y.z" + echo + echo "Environment variables (can be set in .env file):" + echo " MACOS_CERTIFICATE_BASE64: Base64 encoded certificate" + echo " MACOS_CERTIFICATE_PASSWORD: Certificate password" + echo " MACOS_CERTIFICATE_NAME: Certificate name for signing" + echo " APPLE_ID: Apple ID for notarization" + echo " APPLE_TEAM_ID: Apple Team ID for notarization" + echo " APPLE_ID_PASSWORD: App-specific password for Apple ID" + exit 1 +} + +# Function to check required environment variables +check_env_vars() { + local required_vars=( + "MACOS_CERTIFICATE_BASE64" + "MACOS_CERTIFICATE_PASSWORD" + "MACOS_CERTIFICATE_NAME" + "APPLE_ID" + "APPLE_TEAM_ID" + "APPLE_ID_PASSWORD" + ) + + for var in "${required_vars[@]}"; do + if [ -z "${!var}" ]; then + echo "Error: $var is not set. Please set it in your environment or .env file." + exit 1 + fi + done +} + +# Function to ensure create-dmg is installed +ensure_create_dmg_is_installed() { + if ! command -v create-dmg &> /dev/null; then + echo "create-dmg not found. Installing..." + brew install create-dmg + else + echo "create-dmg is already installed." + fi +} + +# Function to create app bundle +create_app_bundle() { + echo "Creating app bundle..." + local bundle_path="target/release/bundle/${ARCH}/${APP_NAME}.app" + mkdir -p "${bundle_path}/Contents/"{MacOS,Resources} + cp "target/${ARCH}-apple-darwin/release/node-gui" "${bundle_path}/Contents/MacOS/" + cp "build-tools/assets/logo.icns" "${bundle_path}/Contents/Resources/" + + echo "Generating Info.plist..." + local version=$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "node-gui") | .version') + local build_number=$(date +%Y%m%d.%H%M%S) + sed -e "s/VERSION_PLACEHOLDER/$version/g" \ + -e "s/BUILD_PLACEHOLDER/$build_number/g" \ + -e "s/MACOS_VERSION_PLACEHOLDER/10.13/g" \ + "build-tools/osx/Info.plist.template" > "${bundle_path}/Contents/Info.plist" +} + +# Function to set up keychain and import certificate +setup_keychain() { + echo "Setting up keychain and importing certificate..." + local certificate_path="$RUNNER_TEMP/build_certificate.p12" + local keychain_path="$RUNNER_TEMP/$KEYCHAIN_NAME" + local apple_cert_path="build-tools/osx/DeveloperIDG2CA.cer" + echo "$MACOS_CERTIFICATE_BASE64" | base64 --decode > "$certificate_path" + security create-keychain -p "$KEYCHAIN_PASSWORD" "$keychain_path" + security set-keychain-settings -lut 21600 "$keychain_path" + security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$keychain_path" + security import "$apple_cert_path" -k "$keychain_path" -T /usr/bin/codesign + security import "$certificate_path" -k "$keychain_path" -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign + security list-keychains -d user -s "$keychain_path" + security default-keychain -s "$keychain_path" + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$keychain_path" +} + +# Function to sign the app +sign_app() { + echo "Signing the app..." + /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" \ + --options runtime \ + --entitlements "build-tools/osx/entitlements.plist" \ + --timestamp "target/release/bundle/${ARCH}/${APP_NAME}.app" -v +} + +# Function to create and sign DMG +create_and_sign_dmg() { + echo "Creating DMG..." + create-dmg \ + --volname "$APP_NAME" \ + --window-pos 200 120 \ + --window-size 600 400 \ + --icon-size 100 \ + --icon "${APP_NAME}.app" 175 120 \ + --hide-extension "${APP_NAME}.app" \ + --app-drop-link 425 120 \ + $DMG_NAME \ + "target/release/bundle/${ARCH}/" + + echo "Signing the DMG..." + /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" \ + --options runtime \ + --timestamp $DMG_NAME -v +} + +# Function to notarize and staple +notarize_and_staple() { + echo "Notarizing the DMG..." + local notarization_output + notarization_output=$(xcrun notarytool submit $DMG_NAME \ + --apple-id "$APPLE_ID" \ + --team-id "$APPLE_TEAM_ID" \ + --password "$APPLE_ID_PASSWORD" \ + --wait --timeout $NOTARIZATION_TIMEOUT) + + echo "Notarization output:" + echo "$notarization_output" + + local submission_id + submission_id=$(echo "$notarization_output" | grep "id:" | head -n 1 | awk '{print $2}') + + if [ -z "$submission_id" ]; then + echo "Failed to extract submission ID. Notarization may have failed." + exit 1 + fi + + echo "Notarization submitted with ID: $submission_id" + + local start_time=$(date +%s) + while true; do + local status_output + status_output=$(xcrun notarytool info "$submission_id" \ + --apple-id "$APPLE_ID" \ + --team-id "$APPLE_TEAM_ID" \ + --password "$APPLE_ID_PASSWORD") + + echo "Notarization status output:" + echo "$status_output" + + local status + status=$(echo "$status_output" | grep "status:" | awk '{print $2}') + + echo "Notarization status: $status" + + if [ "$status" == "Accepted" ]; then + echo "Notarization successful!" + break + elif [ "$status" == "Invalid" ]; then + echo "Notarization failed!" + exit 1 + fi + + local current_time=$(date +%s) + if [ $((current_time - start_time)) -ge $NOTARIZATION_TIMEOUT ]; then + echo "Notarization timed out after $NOTARIZATION_TIMEOUT seconds" + exit 1 + fi + + sleep 10 + done + + echo "Stapling the notarization ticket..." + xcrun stapler staple $DMG_NAME + + echo "Verifying notarization..." + spctl -a -vv -t install $DMG_NAME +} + +# Function to clean up +cleanup() { + echo "Cleaning up..." + security delete-keychain "$RUNNER_TEMP/$KEYCHAIN_NAME" + rm "$RUNNER_TEMP/build_certificate.p12" + if [ -z "${RUNNER_TEMP_PRESERVE}" ]; then + rm -rf "$RUNNER_TEMP" + fi +} + +# Main execution +main() { + if [ $# -eq 0 ]; then + usage + fi + + if [ "$ARCH" != "aarch64" ] && [ "$ARCH" != "x86_64" ]; then + echo "Invalid architecture. Use aarch64 or x86_64." + exit 1 + fi + + if [ -f .env ]; then + set -a + source .env + set +a + fi + + # Set RUNNER_TEMP to a local temporary directory if it's not already set + if [ -z "$RUNNER_TEMP" ]; then + RUNNER_TEMP=$(mktemp -d) + echo "RUNNER_TEMP is not set. Using temporary directory: $RUNNER_TEMP" + fi + + check_env_vars + ensure_create_dmg_is_installed + create_app_bundle + setup_keychain + sign_app + create_and_sign_dmg + notarize_and_staple + cleanup + + echo "Process completed successfully!" +} + +main "$@" \ No newline at end of file diff --git a/common/src/chain/config/checkpoints_data/mainnet.rs b/common/src/chain/config/checkpoints_data/mainnet.rs index 844e29c3f6..8ed6fd1cdc 100644 --- a/common/src/chain/config/checkpoints_data/mainnet.rs +++ b/common/src/chain/config/checkpoints_data/mainnet.rs @@ -85,4 +85,5 @@ pub const CHECKPOINTS_DATA: &[(u64, &str)] = &[ (33000, "F7D86C7C258EE1B1E5419EF1916F80D8545B9DED0128A7DDE0D0575DEDA6A914"), (33500, "173D6A7061247C98520C6054A458C45BF58B2BE92E159C048E730744F63F7822"), (34000, "3F09E2657F250EE3F9674C861344C8F19DFA624851B1AAF7A96A13AF872022C2"), + (162690,"9df649e1f882142a8c5b1d43b985e255dd74ba9b878ab10da191948429504f88"), ]; diff --git a/common/src/chain/config/checkpoints_data/testnet.rs b/common/src/chain/config/checkpoints_data/testnet.rs index 74692449d1..164535ce36 100644 --- a/common/src/chain/config/checkpoints_data/testnet.rs +++ b/common/src/chain/config/checkpoints_data/testnet.rs @@ -340,4 +340,5 @@ pub const CHECKPOINTS_DATA: &[(u64, &str)] = &[ (160500, "1F07F041903123E064EAE4150CA960582E24991DEC4D7DB40E9AA63C4504A409"), (161000, "A615556E0A7E6C24AA925BBEB965903B727443052EBE4A601F024BE6EDEE3FAD"), (161500, "25AF8680F5433BE118B29331A5ECDDB024B401F5D065C25D7CFCF16F56277636"), + (289900, "fb9fdce3d1f8b1bc08f9734e1579af0b986af497a0636c4d806cf49b8c25d0c1"), ]; diff --git a/dns-server/Cargo.toml b/dns-server/Cargo.toml index db85bf7eaa..45a301e2f7 100644 --- a/dns-server/Cargo.toml +++ b/dns-server/Cargo.toml @@ -4,13 +4,11 @@ license.workspace = true version.workspace = true edition.workspace = true rust-version.workspace = true -authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] - -[package.metadata.wix] -upgrade-guid = "9B595854-C39D-4491-B538-D473ECF7F773" -path-guid = "720E3D63-F48B-4952-8B6E-A70D5D9628B3" -license = false -eula = false +authors = [ + "Samer Afach ", + "Ben Marsh ", + "Enrico Rubboli ", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/logo.icns b/logo.icns deleted file mode 100644 index 7d74dd2255..0000000000 Binary files a/logo.icns and /dev/null differ diff --git a/node-daemon/Cargo.toml b/node-daemon/Cargo.toml index 80921e7b58..ae1373a6e0 100644 --- a/node-daemon/Cargo.toml +++ b/node-daemon/Cargo.toml @@ -4,13 +4,11 @@ license.workspace = true version.workspace = true edition.workspace = true rust-version.workspace = true -authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] - -[package.metadata.wix] -upgrade-guid = "0497AE6B-FCA0-4E8E-9FCA-DD8CB4DA074D" -path-guid = "D2982931-51CD-46EF-A94E-E6DB6CADE338" -license = false -eula = false +authors = [ + "Samer Afach ", + "Ben Marsh ", + "Enrico Rubboli ", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/node-daemon/docs/RPC.md b/node-daemon/docs/RPC.md index 88623f19ed..61426fcb4f 100644 --- a/node-daemon/docs/RPC.md +++ b/node-daemon/docs/RPC.md @@ -1,6 +1,6 @@ # RPC documentation for Mintlayer node -Version `0.5.1`. +Version `0.99.0`. ## Module `node` diff --git a/node-daemon/docs/RPC_DEV.md b/node-daemon/docs/RPC_DEV.md index c39982fa12..b073d4394a 100644 --- a/node-daemon/docs/RPC_DEV.md +++ b/node-daemon/docs/RPC_DEV.md @@ -1,6 +1,6 @@ # RPC documentation for Mintlayer node developer functions -Version `0.5.1`. +Version `0.99.0`. These functions are used for testing and only enabled in regtest. diff --git a/node-gui/Cargo.toml b/node-gui/Cargo.toml index 38b6a41a91..e9fcecc807 100644 --- a/node-gui/Cargo.toml +++ b/node-gui/Cargo.toml @@ -5,13 +5,11 @@ license.workspace = true version.workspace = true edition.workspace = true rust-version.workspace = true -authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] - -[package.metadata.wix] -upgrade-guid = "EE04F2A1-4683-4D66-8770-438889AC3FD7" -path-guid = "6AEFEEB1-61AB-407A-8D84-AAF263A1F2F8" -license = false -eula = false +authors = [ + "Samer Afach ", + "Ben Marsh ", + "Enrico Rubboli ", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -30,9 +28,9 @@ utils = { path = "../utils" } wallet = { path = "../wallet" } wallet-controller = { path = "../wallet/wallet-controller" } wallet-types = { path = "../wallet/types" } -wallet-rpc-lib = { path = "../wallet/wallet-rpc-lib"} -wallet-rpc-client = { path = "../wallet/wallet-rpc-client"} -wallet-cli-commands = { path = "../wallet/wallet-cli-commands"} +wallet-rpc-lib = { path = "../wallet/wallet-rpc-lib" } +wallet-rpc-client = { path = "../wallet/wallet-rpc-client" } +wallet-cli-commands = { path = "../wallet/wallet-cli-commands" } anyhow.workspace = true chrono.workspace = true diff --git a/node-gui/src/main.rs b/node-gui/src/main.rs index 5195587217..95f740091e 100644 --- a/node-gui/src/main.rs +++ b/node-gui/src/main.rs @@ -18,6 +18,7 @@ mod main_window; mod widgets; use std::convert::identity; +use std::env; use backend::messages::{BackendEvent, BackendRequest}; use backend::{node_initialize, BackendControls, BackendSender}; diff --git a/wallet/wallet-address-generator/Cargo.toml b/wallet/wallet-address-generator/Cargo.toml index 485aa14566..19cc010606 100644 --- a/wallet/wallet-address-generator/Cargo.toml +++ b/wallet/wallet-address-generator/Cargo.toml @@ -4,13 +4,11 @@ license.workspace = true edition.workspace = true version.workspace = true rust-version.workspace = true -authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] - -[package.metadata.wix] -upgrade-guid = "8925275C-6AA4-4966-A9BB-1E5AED2025C1" -path-guid = "ED873B3C-F1D2-4D64-BC7D-8A85993688F3" -license = false -eula = false +authors = [ + "Samer Afach ", + "Ben Marsh ", + "Enrico Rubboli ", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/wallet/wallet-cli/Cargo.toml b/wallet/wallet-cli/Cargo.toml index f8239e6bd2..67e9d22740 100644 --- a/wallet/wallet-cli/Cargo.toml +++ b/wallet/wallet-cli/Cargo.toml @@ -4,13 +4,11 @@ license.workspace = true edition.workspace = true version.workspace = true rust-version.workspace = true -authors = ["Samer Afach ", "Ben Marsh ", "Enrico Rubboli "] - -[package.metadata.wix] -upgrade-guid = "7CDC9926-E567-4391-B1FD-4C31885AFE39" -path-guid = "B9812B67-3EEB-4A0D-8174-9B34D4CDCB14" -license = false -eula = false +authors = [ + "Samer Afach ", + "Ben Marsh ", + "Enrico Rubboli ", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,4 +17,10 @@ utils = { path = "../../utils" } wallet-cli-lib = { path = "../wallet-cli-lib" } clap = { workspace = true, features = ["derive"] } -tokio = { workspace = true, default-features = false, features = ["io-util", "macros", "net", "rt", "sync"] } +tokio = { workspace = true, default-features = false, features = [ + "io-util", + "macros", + "net", + "rt", + "sync", +] } diff --git a/wallet/wallet-rpc-daemon/Cargo.toml b/wallet/wallet-rpc-daemon/Cargo.toml index 5b9d5dd2ff..b52cde4d42 100644 --- a/wallet/wallet-rpc-daemon/Cargo.toml +++ b/wallet/wallet-rpc-daemon/Cargo.toml @@ -10,12 +10,6 @@ authors = [ "Enrico Rubboli ", ] -[package.metadata.wix] -upgrade-guid = "875D98FA-5A26-487C-ABFF-9E44EFB3B0A3" -path-guid = "9829BB41-3334-4AD7-B2CD-39C758D47919" -license = false -eula = false - [dependencies] common = { path = "../../common" } diff --git a/wallet/wallet-rpc-daemon/docs/RPC.md b/wallet/wallet-rpc-daemon/docs/RPC.md index ad77a706aa..25d89f7d02 100644 --- a/wallet/wallet-rpc-daemon/docs/RPC.md +++ b/wallet/wallet-rpc-daemon/docs/RPC.md @@ -1,6 +1,6 @@ # RPC documentation for Mintlayer node wallet -Version `0.5.1`. +Version `0.99.0`. ## Module `WalletRpc` diff --git a/wasm-wrappers/wasm-doc-gen/Cargo.toml b/wasm-wrappers/wasm-doc-gen/Cargo.toml index f64a2d04ed..26d818e21f 100644 --- a/wasm-wrappers/wasm-doc-gen/Cargo.toml +++ b/wasm-wrappers/wasm-doc-gen/Cargo.toml @@ -5,12 +5,6 @@ version.workspace = true edition.workspace = true rust-version.workspace = true -[package.metadata.wix] -upgrade-guid = "661F3360-B50D-483F-97B0-6ADA8335CDEE" -path-guid = "B5102A6D-96AC-4981-BF1A-2454C1A52A74" -license = false -eula = false - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies]