Skip to content

fix: Make generated EntityBehaviour initializers internal so VContain… #14

fix: Make generated EntityBehaviour initializers internal so VContain…

fix: Make generated EntityBehaviour initializers internal so VContain… #14

Workflow file for this run

name: Build & Publish
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
BUILD_CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
GENESIS_NET_TARGET: netcoreapp3.1
GIT_TERMINAL_PROMPT: 0
COMMIT_USER: github-actions[bot]
COMMIT_EMAIL: github-actions[bot]@users.noreply.github.com
REPO_NAME: CorundumGames.Codegen.Redux
PLUGIN_NAMESPACE: CorundumGames.Codegen.Redux.Plugins
RUNTIME_NAMESPACE: CorundumGames.Codegen.Redux.Runtime
PROJECT_DIR: CorundumGames.Codegen.Redux/CorundumGames.Codegen.Redux
steps:
- name: Check Out
uses: actions/checkout@v3
with:
fetch-depth: 0 # Check out the entire repo
path: "CorundumGames.Codegen.Redux" # See https://github.com/nektos/act#module_not_found
- name: Set Up .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.x'
- name: Set Up NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: 'latest'
- name: Restore Dependencies
working-directory: ${{ env.REPO_NAME }}
run: dotnet restore
- name: Restore Tools
working-directory: ${{ env.REPO_NAME }}
run: dotnet tool restore
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
semantic-release-dotnet
working_directory: ${{ env.REPO_NAME }}
env:
NUGET_TOKEN: ${{ secrets.NUGET_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Plugin
working-directory: ${{ env.REPO_NAME }}
run: dotnet build --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
# Build needs to come after release because the version info is compiled into the assembly
- name: Package for NuGet
working-directory: ${{ env.REPO_NAME }}
run: dotnet pack --configuration ${{ env.BUILD_CONFIGURATION }} --no-build
- name: ZIP for OpenUPM
working-directory: ${{ env.REPO_NAME }}
run: zip --junk-paths --recurse-paths "${{ env.PLUGIN_NAMESPACE }}.zip" "${{ env.PLUGIN_NAMESPACE }}/bin/${{ env.BUILD_CONFIGURATION }}/${{ env.GENESIS_NET_TARGET }}"
- name: Configure Git
working-directory: ${{ env.REPO_NAME }}
run: |
git config --global user.name "$COMMIT_USER"
git config --global user.email "$COMMIT_EMAIL"
- name: Commit Changes to UPM Branch
working-directory: ${{ env.REPO_NAME }}
if: steps.semantic.outputs.new_release_published == 'true' # If we're actually making a new release...
run: |
git checkout --force upm
git checkout --force master package.json README.md LICENSE CHANGELOG.md Unity/Assets "${{ env.RUNTIME_NAMESPACE }}"
# Pull in the relevant files from master
rm --recursive --force Runtime Plugins
mv --force ./Unity/Assets/* .
mv --force "${{ env.PLUGIN_NAMESPACE }}.zip" "Plugins/${{ env.PLUGIN_NAMESPACE }}.zip"
mv --force ${{ env.RUNTIME_NAMESPACE }}/*.cs ./Runtime
rm --recursive --force "${{ env.RUNTIME_NAMESPACE }}"
git add *.meta Plugins Runtime
git commit --all --message "ci: Update upm branch to match ${GITHUB_SHA:0:8}" # First 8 characters
- name: Push UPM branch
working-directory: ${{ env.REPO_NAME }}
if: steps.semantic.outputs.new_release_published == 'true' && !env.ACT # If we're actually making a new release and not running in act...
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git remote set-url origin "https://x-access-token:$GITHUB_TOKEN@github.com/${{ github.repository }}"
git push --force --set-upstream origin upm
- name: Create UPM Git Tag (if necessary)
working-directory: ${{ env.REPO_NAME }}
if: steps.semantic.outputs.new_release_published == 'true' # If we're actually making a new release...
run: |
git tag "$NEW_RELEASE_TAG" upm
env:
NEW_RELEASE_TAG: upm/${{ steps.semantic.outputs.new_release_version }}
- name: Push Tags (if necessary)
working-directory: ${{ env.REPO_NAME }}
if: steps.semantic.outputs.new_release_published == 'true' && !env.ACT # If we're actually making a new release and not running in act...
run: |
git push origin --tags
# - name: Publish to NuGet
# working-directory: "${{ env.REPO_NAME }}"
# if: steps.semantic.outputs.new_release_published == 'true' # If we're actually making a new release...
# run: dotnet nuget push **/*.nupkg --no-symbols --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY"
# env:
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}