灵符lingfu
L

ling-wallet

↓ 0 downloads

Ling Wallet: a post-quantum privacy-coin wallet, full node and HyperTorus miner for LNG

Windows · x86-64 ✕Linux · x86-64 ✕LingOS · x86-64LingOS · Pi 5 ARM64 ✕
Keywords wallet, cryptocurrency, lng, node, miner, ling
lingfu install ling-wallet
LicenseMIT
Authorsling-lin
READMECode / FilesVersionsDependency GraphDependentsSecurityBuildsSettings

Code / Files (116)

.github/workflows/release.yml
name: Release

# Builds the desktop wallet for Windows, Linux and macOS and publishes a GitHub
# Release with the binaries attached. Each platform must build on its own OS —
# `ling build` does not cross-compile (NativePlatform::is_native in ling/src/main.rs).
#
# The wallet depends on the `ling` compiler/runtime (a separate repo). CI checks
# that repo out, builds the `ling` binary, then runs `ling build . --platform <p>`.
# Flags are passed explicitly (--platform, --pack, LING_APP_FEATURES=web) so this
# works against any recent `ling`, even one that predates the Ling.toml fields that
# request the same things for local `lingfu build .`.

on:
  push:
    tags:
      - 'v*'          # e.g. v0.1.0 -> builds and publishes a release
  workflow_dispatch:
    inputs:
      version:
        description: 'Version/tag to publish (e.g. v0.1.0)'
        required: true
        default: 'v0.0.0-dev'
      ling_ref:
        description: 'Branch or tag of taellinglin/ling to build against'
        required: false
        default: 'lingstationx'
      prerelease:
        description: 'Mark the release as a prerelease'
        type: boolean
        default: true

permissions:
  contents: write     # needed to create the release and upload assets

concurrency:
  group: release-${{ github.ref }}
  cancel-in-progress: false

env:
  CARGO_TERM_COLOR: always
  # db_open/db_exec/db_query live behind the ling crate's `web` feature. Without it
  # the built wallet starts but its node and wallet threads die immediately with
  # "unknown function 'db_open'" and it never syncs. (Ling.toml also requests this
  # via `ling-features = ["web"]` for local builds; set here too so CI is robust to
  # older `ling` checkouts that don't read that field.)
  LING_APP_FEATURES: web

jobs:
  build:
    name: Build ${{ matrix.label }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: windows-latest
            platform: win
            label: windows
            dist: dist/windows
            bin: ling-wallet.exe
          - os: ubuntu-latest
            platform: lin
            label: linux
            dist: dist/linux
            bin: ling-wallet
          - os: macos-13           # Intel runner: openh264 (pulled in by `web`) builds cleanly with NASM here.
            platform: mac           # The binary also runs on Apple Silicon via Rosetta.
            label: macos
            dist: dist/macos
            bin: ling-wallet
    steps:
      - name: Checkout ling-wallet
        uses: actions/checkout@v4

      - name: Checkout ling (compiler + runtime)
        uses: actions/checkout@v4
        with:
          repository: taellinglin/ling
          ref: ${{ github.event.inputs.ling_ref || 'lingstationx' }}
          path: ling

      - name: Install Rust (stable)
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: |
            ling
            .ling-build/ling-wallet

      - name: Install NASM (openh264 build via the web feature)
        uses: ilammy/setup-nasm@v1

      - name: Install Linux system dependencies
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y --no-install-recommends \
            libasound2-dev libudev-dev libxkbcommon-dev libwayland-dev xorg-dev

      - name: Build the ling toolchain
        working-directory: ling
        run: cargo build --release --bin ling

      - name: Resolve version
        id: ver
        shell: bash
        run: |
          if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
            v="${{ github.event.inputs.version }}"
          else
            v="${{ github.ref_name }}"
          fi
          echo "version=$v" >> "$GITHUB_OUTPUT"
          echo "VERSION=$v" >> "$GITHUB_ENV"

      - name: Build the wallet (${{ matrix.platform }})
        shell: bash
        env:
          LING_HOME: ${{ github.workspace }}/ling
        run: |
          ling_bin="ling/target/release/ling"
          [ "${{ runner.os }}" = "Windows" ] && ling_bin="ling/target/release/ling.exe"
          "$ling_bin" build . --platform ${{ matrix.platform }} --pack
          echo "---- ${{ matrix.dist }} ----"
          ls -la "${{ matrix.dist }}"

      - name: Package asset
        shell: bash
        run: |
          mkdir -p out
          name="ling-wallet-${VERSION}-${{ matrix.label }}"
          if [ "${{ runner.os }}" = "Windows" ]; then
            cp "${{ matrix.dist }}/${{ matrix.bin }}" "out/${name}.exe"
          else
            chmod +x "${{ matrix.dist }}/${{ matrix.bin }}"
            tar -C "${{ matrix.dist }}" -czf "out/${name}.tar.gz" "${{ matrix.bin }}"
          fi
          ls -la out

      - name: Upload build artifact
        uses: actions/upload-artifact@v4
        with:
          name: ling-wallet-${{ matrix.label }}
          path: out/*
          if-no-files-found: error

  build-lingos:
    name: Build LingOS userland (x86-64 + rpi)
    runs-on: ubuntu-latest
    steps:
      - name: Checkout ling-wallet
        uses: actions/checkout@v4

      - name: Checkout ling (compiler + runtime)
        uses: actions/checkout@v4
        with:
          repository: taellinglin/ling
          ref: ${{ github.event.inputs.ling_ref || 'lingstationx' }}
          path: ling

      - name: Install Rust (stable + nightly with rust-src)
        run: |
          rustup toolchain install stable --profile minimal
          rustup toolchain install nightly --profile minimal --component rust-src

      - name: Cache cargo
        uses: Swatinem/rust-cache@v2
        with:
          workspaces: ling

      - name: Build the ling toolchain
        working-directory: ling
        run: cargo +stable build --release --bin ling

      - name: Resolve version
        shell: bash
        run: |
          if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
            echo "VERSION=${{ github.event.inputs.version }}" >> "$GITHUB_ENV"
          else
            echo "VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV"
          fi

      - name: Build LingOS userland images
        env:
          LING_HOME: ${{ github.workspace }}/ling
        run: |
          ling/target/release/ling build . --platform lingos --pack
          ling/target/release/ling build . --platform lingos-rpi --pack
          ls -laR dist

      - name: Package assets
        run: |
          mkdir -p out
          tar -C dist/apps -czf "out/ling-wallet-${VERSION}-lingos.tar.gz" .
          tar -C dist/apps-rpi -czf "out/ling-wallet-${VERSION}-lingos-rpi.tar.gz" .
          ls -la out

      - name: Upload build artifact
        uses: actions/upload-artifact@v4
        with:
          name: ling-wallet-lingos
          path: out/*
          if-no-files-found: error

  release:
    name: Publish GitHub Release
    needs: [build, build-lingos]
    runs-on: ubuntu-latest
    steps:
      - name: Download all build artifacts
        uses: actions/download-artifact@v4
        with:
          path: artifacts
          merge-multiple: true

      - name: List artifacts
        run: ls -R artifacts

      - name: Resolve release metadata
        id: meta
        shell: bash
        run: |
          if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
            echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
            echo "prerelease=${{ github.event.inputs.prerelease }}" >> "$GITHUB_OUTPUT"
          else
            echo "version=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
            echo "prerelease=false" >> "$GITHUB_OUTPUT"
          fi

      - name: Publish release
        uses: softprops/action-gh-release@v2
        with:
          tag_name: ${{ steps.meta.outputs.version }}
          name: Ling Wallet ${{ steps.meta.outputs.version }}
          prerelease: ${{ steps.meta.outputs.prerelease }}
          files: artifacts/**
          fail_on_unmatched_files: true
          body: |
            Ling Wallet ${{ steps.meta.outputs.version }} — desktop wallet, full node and miner for LNG.

            **Downloads**
            - Windows: `ling-wallet-${{ steps.meta.outputs.version }}-windows.exe`
            - Linux: `ling-wallet-${{ steps.meta.outputs.version }}-linux.tar.gz`
            - macOS (Intel; runs on Apple Silicon via Rosetta): `ling-wallet-${{ steps.meta.outputs.version }}-macos.tar.gz`
            - LingOS userland (x86-64): `ling-wallet-${{ steps.meta.outputs.version }}-lingos.tar.gz`
            - LingOS userland (Raspberry Pi 5): `ling-wallet-${{ steps.meta.outputs.version }}-lingos-rpi.tar.gz`

            Each download is a single self-contained executable (sources and assets are packed inside).

            > LNG is a new, unaudited, experimental coin. Use at your own risk.

← Back to index