Skip to content

Commit

Permalink
setup github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tkachov committed Feb 11, 2024
1 parent a1be1aa commit 399eb76
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/Overstrike Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Overstrike Release"

permissions:
contents: write
packages: read

on:
push:
tags:
- "OS/v*"

env:
CSPROJ: Overstrike/Overstrike.csproj
PUBLISH_DIR: Overstrike/bin/Release/net7.0-windows/publish/win-x64/

jobs:
publish:
runs-on: windows-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Publish the project
run: dotnet publish ${{ env.CSPROJ }} -p:PublishProfile=FolderProfile

- name: Add LICENSE.txt
run: cp LICENSE.txt ${{ env.PUBLISH_DIR }}

- name: Generate names by tag
id: names
shell: bash
run: |
{
ref="${{ github.ref }}"
ref=${ref//refs\/tags\//}
release_name=${ref/OS\/v/Overstrike (v. }
echo "release_name=${release_name})" >> $GITHUB_OUTPUT
archive_name=${ref/OS\/v/Overstrike_v}
archive_name=${archive_name// /_}
echo "archive_name=${archive_name}.zip" >> $GITHUB_OUTPUT
}
- name: Zip the files
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: ${{ steps.names.outputs.archive_name }}
directory: ${{ env.PUBLISH_DIR }}
exclusions: "*.pdb"

- name: Create release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.names.outputs.release_name }}
body: ""
artifacts: "${{ env.PUBLISH_DIR }}${{ steps.names.outputs.archive_name }}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ publish/
*.pubxml
*.publishproj

!Overstrike/Properties/PublishProfiles/FolderProfile.pubxml

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
Expand Down
18 changes: 18 additions & 0 deletions Overstrike/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<PublishDir>bin\Release\net7.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>

0 comments on commit 399eb76

Please sign in to comment.