43 lines
933 B
YAML
43 lines
933 B
YAML
name: First CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
rid: ["win-x64", "linux-x64"]
|
|
outputs:
|
|
rid: ${{ matrix.rid }}-output
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: "6.0.x"
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
|
|
- name: Publish artifacts
|
|
id: publish
|
|
run: |
|
|
dotnet publish -o app -r ${{ matrix.rid }} --self-contained true
|
|
echo "::set-output name=artifact-path::$(pwd)/app"
|
|
|
|
upload:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ needs.build.outputs.rid }}
|
|
path: ${{ needs.build.outputs['publish.artifact-path'] }}
|