Something went wrong. Try again.
The format that's super! duper.dev.br
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183on: push: tags: ["EpicEric.Duper@*.*.*"]
permissions: contents: read
env: RUST_VERSION: "1.94.0" CARGO_INCREMENTAL: "0" CARGO_PROFILE_TEST_DEBUG: "0" DOTNET_VERSION: "8.0.x"
jobs: build: strategy: fail-fast: false matrix: include: - runner: ubuntu-24.04 target: x86_64-unknown-linux-gnu os: linux - runner: ubuntu-24.04 target: aarch64-unknown-linux-gnu os: linux - runner: ubuntu-24.04 target: x86_64-unknown-linux-musl os: linux - runner: ubuntu-24.04 target: aarch64-unknown-linux-musl os: linux - runner: ubuntu-24.04 target: x86_64-pc-windows-msvc os: windows # https://github.com/EpicEric/duper/issues/41 # - runner: ubuntu-24.04 # target: aarch64-pc-windows-msvc # os: windows - runner: macos-15 target: x86_64-apple-darwin os: macos - runner: macos-15 target: aarch64-apple-darwin os: macos name: Build and package (${{ matrix.target }}) runs-on: ${{ matrix.runner }} steps: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: true - name: Fetch MSRV and add target run: | rustup toolchain install ${RUST_VERSION} rustup override set ${RUST_VERSION} rustup target add ${{ matrix.target }} - name: Cache Rust dependencies uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 - name: Install Zig if: matrix.os == 'linux' uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5 with: version: latest - name: Install cargo-zigbuild (Linux) if: matrix.os == 'linux' uses: taiki-e/install-action@a24ba45235ed716ff76646268742990dc9458860 # v2.62.42 with: tool: cargo-zigbuild - name: Install lld (macOS) if: matrix.os == 'macos' run: | brew install lld - name: Install llvm-dev and cargo-xwin (Windows) if: matrix.os == 'windows' run: | sudo apt-get install -y llvm-dev rustup component add llvm-tools cargo install --locked cargo-xwin - name: Build with cargo-zigbuild (Linux) if: matrix.os == 'linux' env: RUSTFLAGS: -Ctarget-feature=-crt-static run: | cargo zigbuild --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_uniffi/Cargo.toml - name: Build with cargo (macOS) if: matrix.os == 'macos' run: | cargo build --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_uniffi/Cargo.toml - name: Build with cargo-xwin (Windows) if: matrix.os == 'windows' run: | cargo xwin build --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_uniffi/Cargo.toml - name: Copy dynamic library to dist (Linux) if: matrix.os == 'linux' run: | mkdir -p dist/${{ matrix.target }} cp target/${{ matrix.target }}/release/libduper_uniffi.so dist/${{ matrix.target }}/ - name: Copy dynamic library to dist (macOS) if: matrix.os == 'macos' run: | mkdir -p dist/${{ matrix.target }} cp target/${{ matrix.target }}/release/libduper_uniffi.dylib dist/${{ matrix.target }}/ - name: Copy dynamic library to dist (Windows) if: matrix.os == 'windows' shell: bash run: | mkdir -p dist/${{ matrix.target }} cp target/${{ matrix.target }}/release/duper_uniffi.dll dist/${{ matrix.target }}/ - name: Upload artifacts uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: dist-${{ matrix.target }} path: dist
release: name: Release .NET package runs-on: ubuntu-24.04 environment: nuget permissions: id-token: write needs: build steps: - name: Checkout repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: true - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: dist-x86_64-unknown-linux-gnu path: dist - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: dist-aarch64-unknown-linux-gnu path: dist - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: dist-x86_64-unknown-linux-musl path: dist - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: dist-aarch64-unknown-linux-musl path: dist - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: dist-x86_64-pc-windows-msvc path: dist # https://github.com/EpicEric/duper/issues/41 # - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 # with: # name: dist-aarch64-pc-windows-msvc # path: dist - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: dist-x86_64-apple-darwin path: dist - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 with: name: dist-aarch64-apple-darwin path: dist - run: | ls -al ./dist
- name: Setup .NET uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0 with: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Build project working-directory: duper_uniffi/dotnet run: | dotnet build dotnet pack - name: Login to NuGet uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1 id: login with: user: ${{ vars.NUGET_USER }} - name: Publish to NuGet working-directory: duper_uniffi/dotnet run: | dotnet nuget push bin/Release/*.nupkg --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json env: NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}