Skip to content

chore(v0.0.5): Ship TC libraries with nuget package #22

chore(v0.0.5): Ship TC libraries with nuget package

chore(v0.0.5): Ship TC libraries with nuget package #22

Workflow file for this run

name: CI/CD
on:
push:
branches:
- main
paths:
- 'src/**'
pull_request:
branches: [ main ]
paths:
- 'src/**'
workflow_dispatch:
env:
dotnet_versions: |
6.0.x
8.0.x
jobs:
ci-tchaxx-snappy-cli:
name: CI - TcHaxx.Snappy.CLI
runs-on: ubuntu-latest
env:
solution: ./TcHaxx.Snappy.CLI.sln
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{env.dotnet_versions}}
- name: Restore dependencies
run: dotnet restore ${{ env.solution }}
- name: Build
run: dotnet build -c Release --no-restore ${{ env.solution }}
- name: Test
if: success()
run: dotnet test -c Release --no-build --verbosity normal ${{ env.solution }}
ci-tchaxx-snappy-tc:
name: CI - TcHaxx.Snappy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build TcHaxx.Snappy
uses: Zeugwerk/zkbuild-action@1.0.0
with:
username: ${{ secrets.ACTIONS_ZGWK_USERNAME }}
password: ${{ secrets.ACTIONS_ZGWK_PASSWORD }}
- name: Upload *.library
uses: actions/upload-artifact@v4
with:
name: snappy
path: |
**/*.library
cd-tchaxx-snappy-cli:
needs: ci-tchaxx-snappy-cli
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
name: CD - TcHaxx.Snappy.CLI
runs-on: ubuntu-latest
permissions:
contents: write
env:
solution: ./TcHaxx.Snappy.CLI.sln
csproj: ./src/TcHaxx.Snappy.CLI/TcHaxx.Snappy.CLI.csproj
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.dotnet_versions }}
- uses: actions/download-artifact@v4
with:
name: snappy
path: .dist/
- name: Download latest rplc.library
run: curl -L https://github.com/tchaxx/rplc/releases/latest/download/rplc.library -o .dist/rplc.library
- name: Restore dependencies
run: dotnet restore ${{ env.solution }}
- name: Pack
env:
INCLUDE_TC_LIBRARIES: true
run: dotnet pack -c Release --no-restore ${{ env.solution }}
- name: Publish on version change
id: publish_nuget
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: ${{ env.csproj }}
NUGET_KEY: ${{ secrets.TCHAXX_NUGET_API_KEY }}