Bump up the version to v0.1.0-alpha.6 #12
Workflow file for this run
This file contains 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: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: x86_64-pc-windows-msvc | |
override: true | |
- name: Install uniffi-bindgen-cs | |
run: cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.7.0+v0.25.0 | |
- name: Build tapyrus-wallet-ffi | |
run: | | |
cd tapyrus-wallet-ffi | |
cargo build --release | |
- name: Generate CSharp binding file | |
run: | | |
cd tapyrus-wallet-ffi | |
uniffi-bindgen-cs target/release/tapyrus_wallet_ffi.dll --library --out-dir ..\TapyrusWalletCSharp\TapyrusWalletCSharp\src\com\chaintope\tapyrus\wallet\ | |
- name: Build C# binding | |
run: | | |
cd TapyrusWalletCSharp\TapyrusWalletCSharp | |
dotnet build -c Release -r win-x64 | |
- name: Build C# docs | |
run: | | |
cd TapyrusWalletCSharp | |
dotnet tool install -g docfx | |
docfx metadata | |
docfx build | |
- name: Prepare release artifacts | |
run: | | |
mkdir release | |
cp TapyrusWalletCSharp\TapyrusWalletCSharp\bin\Release\net6.0\win-x64\TapyrusWalletCSharp.dll release\ | |
cp tapyrus-wallet-ffi\target\release\tapyrus_wallet_ffi.dll release\ | |
cp -r TapyrusWalletCSharp release\TapyrusWalletCSharp | |
cp -r TapyrusWalletCSharp\_site release\docs | |
Remove-Item -Recurse -Force release\TapyrusWalletCSharp\TapyrusWalletCSharp\bin, release\TapyrusWalletCSharp\TapyrusWalletCSharp\obj | |
- name: Set ZIP file name | |
run: echo "ZIP_NAME=tapyrus-wallet-csharp-win-x64-${GITHUB_REF##*/}.zip" >> $env:GITHUB_ENV | |
- name: Create ZIP archive | |
shell: pwsh | |
run: | | |
$zipName = "${{ env.ZIP_NAME }}" | |
Write-Host "Creating ZIP archive: $zipName" | |
Compress-Archive -Path .\release\* -DestinationPath .\$zipName | |
- name: Verify ZIP file | |
shell: pwsh | |
run: | | |
$zipName = "${{ env.ZIP_NAME }}" | |
if (-Not (Test-Path -Path $zipName)) { | |
throw "ZIP file not found: $zipName" | |
} | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.ZIP_NAME }} | |
asset_name: ${{ env.ZIP_NAME }} | |
asset_content_type: application/zip |