Skip to content

CI/CD

CI/CD #354

Workflow file for this run

name: CI/CD
on: [push, pull_request, workflow_dispatch]
jobs:
job:
permissions: write-all
name: CI/CD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ hashFiles('**/*.csproj') }}
- name: Build
run: dotnet build -warnaserror
- name: Build nuget
if: github.event_name == 'workflow_dispatch'
run: dotnet pack PolyMod.csproj -o nuget
- name: Deploy nuget
if: github.event_name == 'workflow_dispatch'
run: dotnet nuget push -s https://polymod.dev/nuget/v3/index.json -k ${{ secrets.KEY }} nuget/*.nupkg
- name: Get version
if: github.event_name == 'workflow_dispatch'
id: version
uses: kzrnm/get-net-sdk-project-versions-action@v2
with:
proj-path: PolyMod.csproj
- name: Deploy release
if: github.event_name == 'workflow_dispatch'
run: |
if [[ "${{ steps.version.outputs.version }}" == *"-"* ]]; then
gh release create v${{ steps.version.outputs.version }} bin/IL2CPP/net6.0/PolyMod.dll -p -t v${{ steps.version.outputs.version }}
else
gh release create v${{ steps.version.outputs.version }} bin/IL2CPP/net6.0/PolyMod.dll -t v${{ steps.version.outputs.version }}
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}