-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (79 loc) · 2.81 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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_name }}.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