Skip to content

Commit

Permalink
added workflow
Browse files Browse the repository at this point in the history
improve solution.
  • Loading branch information
kianzarrin committed Apr 22, 2021
1 parent 70d4479 commit cacbfd6
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 4 deletions.
File renamed without changes.
75 changes: 75 additions & 0 deletions .github/workflows/Main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Create Release

on:
push:
tags: ['*']

jobs:
build:
name: Build and Upload Release Asset

runs-on: windows-latest

env:
ModName: AdaptiveRoads
Solution_File: AdaptiveRoads.sln
DeployDir: Deploy/Debug/bin

steps:
- name: Get Sources
uses: actions/checkout@v2
with:
submodules: true

- name: Setup Build Environment
uses: microsoft/setup-msbuild@v1

- name: Get Referenced Binaries
uses: actions/checkout@v2
with:
repository: kianzarrin/CSBinaries
ref: refs/heads/master
path: dependencies
token: ${{ secrets.CSBINARIES_REPO_PAT }}

- name: Build Solution
id: build_solution
run: msbuild "${{ env.Solution_File }}" /m /verbosity:normal /restore /p:Configuration=Debug /p:DeployDir="$env:GITHUB_WORKSPACE/$env:DeployDir"

- name: Get Version Number
id: get_version_number
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash

- name: Pack Assets
id: pack_assets
run: |
$ErrorView = 'NormalView'
$env:ASSET_FILE_NAME = "${{ env.ModName }}-${{ steps.get_version_number.outputs.VERSION }}.zip"
$env:ASSET_FILE = "$env:GITHUB_WORKSPACE/$env:DeployDir/$env:ASSET_FILE_NAME"
echo "zipping $env:GITHUB_WORKSPACE/$env:DeployDir/ to $env:ASSET_FILE ..."
Compress-Archive -Path $env:GITHUB_WORKSPACE/$env:DeployDir/** -DestinationPath $env:ASSET_FILE -CompressionLevel Optimal
echo "::set-output name=ASSET_FILE::$env:ASSET_FILE"
echo "::set-output name=ASSET_FILE_NAME::$env:ASSET_FILE_NAME"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.get_version_number.outputs.VERSION }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.pack_assets.outputs.ASSET_FILE }}
asset_name: ${{ steps.pack_assets.outputs.ASSET_FILE_NAME }}
asset_content_type: application/zip
9 changes: 9 additions & 0 deletions PedestrianBridge.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,25 @@ VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PedestrianBridge", "PedestrianBridge\PedestrianBridge.csproj", "{3818BA07-D208-4D16-B078-DFA47D4B8BFA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{262374CD-55E2-47D5-AE34-07E185A30E09}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.github\workflows\Main.yml = .github\workflows\Main.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Workshop|Any CPU = Workshop|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3818BA07-D208-4D16-B078-DFA47D4B8BFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3818BA07-D208-4D16-B078-DFA47D4B8BFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3818BA07-D208-4D16-B078-DFA47D4B8BFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3818BA07-D208-4D16-B078-DFA47D4B8BFA}.Release|Any CPU.Build.0 = Release|Any CPU
{3818BA07-D208-4D16-B078-DFA47D4B8BFA}.Workshop|Any CPU.ActiveCfg = Workshop|Any CPU
{3818BA07-D208-4D16-B078-DFA47D4B8BFA}.Workshop|Any CPU.Build.0 = Workshop|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 2 additions & 4 deletions PedestrianBridge/PedestrianBridge.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net35</TargetFramework>
<Deterministic>false</Deterministic>
Expand Down Expand Up @@ -51,9 +51,7 @@
<Reference Include="UnityEngine" />
<Reference Include="UnityEngine.UI" />
<Reference Include="CSUtil.Commons" />
<Reference Include="FineRoadTool">
<HintPath>..\..\AutomaticRoundaboutBuilder\dependencies\FineRoadTool.dll</HintPath>
</Reference>
<Reference Include="FineRoadTool" />
<Reference Include="TrafficManager" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit cacbfd6

Please sign in to comment.