Skip to content

Commit

Permalink
update ci actions
Browse files Browse the repository at this point in the history
  • Loading branch information
brettfo committed Jun 29, 2024
1 parent b082a61 commit 9667ee5
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,51 @@ name: CI
on: [push, pull_request]

jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Build and test
shell: pwsh
run: ./build-and-test.ps1 -configuration ${{ matrix.configuration }}
- name: Publish WASM artifact
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest' && matrix.configuration == 'Release'
with:
name: wasm
path: ./artifacts/wasm/wwwroot
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Build and test
shell: pwsh
run: ./build-and-test.ps1 -configuration ${{ matrix.configuration }}
- name: Publish WASM artifact
uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest' && matrix.configuration == 'Release'
with:
name: wasm
path: ./artifacts/wasm/wwwroot

per-build-publish:
if: github.ref == 'refs/heads/main'
needs: [build]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- run: .\create-version-suffix.ps1
- run: .\build-and-test.ps1 -configuration Release -notest -versionSuffix ${{ env.VERSION_SUFFIX }}
- run: dotnet nuget push .\artifacts\packages\Release\*.nupkg -s https://nuget.pkg.github.com/ixmilia/index.json -k ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: .\create-version-suffix.ps1
- run: .\build-and-test.ps1 -configuration Release -notest -versionSuffix ${{ env.VERSION_SUFFIX }}
- run: dotnet nuget push .\artifacts\packages\Release\*.nupkg -s https://nuget.pkg.github.com/ixmilia/index.json -k ${{ secrets.GITHUB_TOKEN }}

nuget-publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- run: .\build-and-test.ps1 -configuration Release -notest
- run: dotnet nuget push .\artifacts\packages\Release\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: .\build-and-test.ps1 -configuration Release -notest
- run: dotnet nuget push .\artifacts\packages\Release\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}

0 comments on commit 9667ee5

Please sign in to comment.