Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build #16

Merged
merged 20 commits into from
Jan 11, 2024
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
PROJECT_NAME: RetakesAllocator

jobs:
build:
Expand All @@ -22,9 +19,13 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
shell: bash
run: dotnet build --no-restore -c Release
- name: Package
working-directory: ${{github.workspace}}/RetakesAllocator/
run: chmod +x release.bash; ./release.bash
- name: Publish DLL artifact
uses: actions/upload-artifact@v4
with:
name: $PROJECT_NAME-$GITHUB_REF_NAME-$GITHUB_SHA
path: ./bin/Release/net7.0/$PROJECT_NAME.zip
name: RetakesAllocator-${{github.sha}}
path: ${{github.workspace}}/RetakesAllocator/bin/Release/RetakesAllocator.zip
6 changes: 3 additions & 3 deletions RetakesAllocator/RetakesAllocator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<ProjectReference Include="..\RetakesAllocatorCore\RetakesAllocatorCore.csproj" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition=" '$(CopyPath)' != '' and $(Configuration) == 'Debug'">
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition=" '$(CopyPath)' != '' and $(Configuration) == 'Debug' and '$(OS)' == 'Windows_NT'">
<Exec Command="powershell mkdir -p &quot;$(CopyPath)&quot;" ContinueOnError="true" />
<Exec Command=" powershell Copy-Item -Recurse -Force &quot;$(TargetDir)* $(CopyPath)&quot; "/>
<Exec Command="powershell Copy-Item -Recurse -Force &quot;$(TargetDir)* $(CopyPath)&quot; "/>
</Target>
<Target Name="PostBuildRelease" AfterTargets="PostBuildEvent" Condition="$(Configuration) == 'Release'">
<Target Name="PostBuildRelease" AfterTargets="PostBuildEvent" Condition="$(Configuration) == 'Release' and '$(OS)' == 'Windows_NT'">
<Exec Command="powershell rm -Recurse -Force &quot;$(TargetDir)..\$(TargetName)&quot; " ContinueOnError="true"/>
<Exec Command="powershell mkdir -p &quot;$(TargetDir)..\$(TargetName)&quot;" />
<Exec Command="powershell cp -Force &quot;$(TargetDir)* $(TargetDir)..\$(TargetName)&quot;" />
Expand Down
22 changes: 22 additions & 0 deletions RetakesAllocator/release.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

TARGET_NAME="RetakesAllocator"
TARGET_DIR="./bin/Release/net7.0"
NEW_DIR="$TARGET_DIR/../$TARGET_NAME"

echo $TARGET_NAME
echo $TARGET_DIR
echo $NEW_DIR

ls $TARGET_DIR/**

echo mkdir -p $NEW_DIR
mkdir -p $NEW_DIR
echo cp -rf "$TARGET_DIR/runtimes/linux-x64" "$NEW_DIR/runtimes"
cp -rf "$TARGET_DIR/runtimes/linux-x64" "$NEW_DIR/runtimes"
echo cp -rf "$TARGET_DIR/runtimes/win-x64" "$NEW_DIR/runtimes"
cp -rf "$TARGET_DIR/runtimes/win-x64" "$NEW_DIR/runtimes"
echo zip -r "$TARGET_NAME.zip" "$NEW_DIR/"
zip -r "./bin/Release/$TARGET_NAME.zip" "$NEW_DIR/"

ls ./bin/**