Skip to content

Merge branch 'master' of https://github.com/sebas77/Svelto.ECS #35

Merge branch 'master' of https://github.com/sebas77/Svelto.ECS

Merge branch 'master' of https://github.com/sebas77/Svelto.ECS #35

Workflow file for this run

name: Svelto.ECS Nuget Release
on:
workflow_dispatch:
inputs:
name:
description: 'Reason'
default: 'Manual workflow triggering'
push:
branches:
- master
paths:
- com.sebaslab.svelto.ecs/version.json
jobs:
build:
env:
PKG_NAME: Svelto.ECS
ECS_VERSION_JSON: com.sebaslab.svelto.ecs/version.json
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: init submodules
run: git submodule update --init
- name: get preparation tools
run: git clone https://github.com/Ujinjinjin/upm-preparator.git --branch v1.0.12 --single-branch
- name: create temp directory
run: mkdir temp temp/bin temp/bin/debug temp/bin/release
- name: get Svelto.ECS version
run: python3 upm-preparator/version.py --version-file "${ECS_VERSION_JSON}" --env-file "${GITHUB_ENV}"
# Build for Debug
- name: create package for Debug configuration
run: dotnet pack /p:PackageVersion=${{ env.PKG_VERSION }} -o temp/bin/debug com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c Debug
- name: unzip debug nuget package
run: unzip temp/bin/debug/Svelto.ECS.${{ env.PKG_VERSION }}.nupkg -d temp/bin/debug
- name: copy debug DLL to temp folder
run: sudo cp temp/bin/debug/lib/netstandard2.1/Svelto.ECS.dll temp/bin/debug
# Build for Release
- name: create package for Release configuration
run: dotnet pack /p:PackageVersion=${{ env.PKG_VERSION }} -o temp/bin/release com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c Release
- name: unzip release nuget package
run: unzip temp/bin/release/Svelto.ECS.${{ env.PKG_VERSION }}.nupkg -d temp/bin/release
- name: copy release DLL to temp folder
run: sudo cp temp/bin/release/lib/netstandard2.1/Svelto.ECS.dll temp/bin/release
# Compile into nuget package
- name: build nuget package
run: sudo dotnet pack /p:PackageVersion=${PKG_VERSION} -o . com.sebaslab.svelto.ecs/Svelto.ECS.csproj -c NugetPack
- uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}.${{ env.PKG_VERSION }}.nupkg
path: ${{ env.PKG_NAME }}.${{ env.PKG_VERSION }}.nupkg
- name: publish nuget package
run: dotnet nuget push ${{ env.PKG_NAME }}.${{ env.PKG_VERSION }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json