feat(actions): upload build artifact #2143
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 Library" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
env: | |
DOTNET_NOLOGO: true | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true | |
jobs: | |
build: | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
name: Build library | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: | | |
8.0.100 | |
7.0.404 | |
6.x | |
- name: Build library | |
run: dotnet build -c Release -v minimal DisCatSharp.sln | |
- name: Test library | |
run: dotnet test -v minimal -c Release --no-restore --no-build DisCatSharp.sln | |
pack: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: | | |
8.0.100 | |
7.0.404 | |
6.x | |
- name: Build library | |
run: dotnet build -c Release -v minimal DisCatSharp.sln | |
- name: Publish library | |
run: dotnet pack -c Release -v minimal DisCatSharp.sln --no-build --no-restore --include-symbols --include-source -o ./artifacts DisCatSharp.sln | |
- name: Zip artifact files | |
uses: vimtor/[email protected] | |
with: | |
files: ./artifacts/ | |
dest: ./DisCatSharp.zip | |
- name: Upload artifacts | |
uses: actions/[email protected] | |
with: | |
name: DisCatSharp.zip | |
path: ./DisCatSharp.zip |