dep: Update dependency Microsoft.SourceLink.GitHub to v8 #375
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: CI | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
ProjectName: ${{ github.event.repository.name }} | |
RustProjectName: cryptobase | |
jobs: | |
check_format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Check .NET format | |
working-directory: src | |
run: dotnet format -v diag --verify-no-changes | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
default: true | |
components: clippy | |
- name: Check Rust format | |
working-directory: native/${{ env.RustProjectName }} | |
run: cargo clippy --release --all-targets --all-features | |
build-native: | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
- os: windows-latest | |
target: i686-pc-windows-msvc | |
- os: windows-latest | |
target: aarch64-pc-windows-msvc | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: armv7-unknown-linux-gnueabihf | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
- os: ubuntu-latest | |
target: armv7-unknown-linux-musleabihf | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
runs-on: ${{ matrix.os }} | |
env: | |
RUST_BACKTRACE: full | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
target: ${{ matrix.target }} | |
toolchain: stable | |
default: true | |
- name: Install cross | |
if: matrix.os == 'ubuntu-latest' | |
run: cargo install cross | |
- name: Build ${{ matrix.target }} | |
shell: pwsh | |
run: .\build\build-native.ps1 ${{ matrix.target }} | |
- name: Upload ${{ matrix.target }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: runtimes | |
path: src/${{ env.ProjectName }}/runtimes/ | |
test: | |
needs: [build-native] | |
runs-on: ${{ matrix.os }} | |
env: | |
RUST_BACKTRACE: full | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- ubuntu-latest | |
# - macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: runtimes | |
path: src/${{ env.ProjectName }}/runtimes/ | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Run tests | |
working-directory: src/${{ env.ProjectName }}.Tests | |
run: dotnet test -c Release | |
build: | |
needs: [check_format, test] | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
NugetProjectName: | |
- CryptoBase | |
- CryptoBase.Abstractions | |
- CryptoBase.BouncyCastle | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Build | |
working-directory: src/${{ matrix.NugetProjectName }} | |
run: dotnet build -c Release | |
- name: Push nuget packages | |
working-directory: src/${{ matrix.NugetProjectName }}/bin/Release | |
run: | | |
dotnet nuget push *.nupkg -s https://nuget.pkg.github.com/HMBSbige -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate | |
dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetAPIKey }} --skip-duplicate | |
dotnet nuget push *.snupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetAPIKey }} --skip-duplicate | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Changelog | |
uses: glennawatson/ChangeLog@v1 | |
id: changelog | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: ${{ steps.changelog.outputs.commitLog }} | |
draft: false | |
prerelease: false |