Skip to content

Try install nasm

Try install nasm #38

name: "Build On Windows"
on: [push]
jobs:
build: # job id, can be any string
# Job name is Build And Publish
name: Build
# This job runs on Linux
strategy:
matrix:
os: [windows-latest]
rust: [stable]
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc]
# x86_64-pc-windows-gnu, i686-pc-windows-gnu,
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache cargo modules
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
default: true
override: true
components: "rustfmt, clippy, cargo, rust-docs"
- name: Install nasm and bindgen-cli
run: |
cargo install bindgen-cli
choco install -y nasm
- name: Cargo Release build
uses: actions-rs/cargo@v1
if: ${{ matrix.target != 'x86_64-pc-windows-gnu' }}
with:
use-cross: false
command: build
args: --target ${{ matrix.target }} --release --jobs 2 --verbose
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --release --verbose --target ${{ matrix.target }} --bin ddns-cli
- name: Prepare package
shell: pwsh
if: ${{ contains(github.ref, 'refs/tags/') }}
run: |
cd "$ENV:GITHUB_WORKSPACE/target/${{ matrix.target }}/release/" ;
New-Item -Force -ItemType Directory bin ;
Copy-Item -Force ddns-cli.exe bin/ ;
if ( Test-Path "${{ matrix.target }}.zip" ) { Remove-Item -Force "${{ matrix.target }}.zip" }
Compress-Archive -DestinationPath "${{ matrix.target }}.zip" -Path bin
cd "$ENV:GITHUB_WORKSPACE" ;
- uses: xresloader/upload-to-github-release@master
if: ${{ contains(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "target/${{ matrix.target }}/release/${{ matrix.target }}.zip"
tags: true
draft: false
prerelease: false
overwrite: true