Skip to content

Commit c247e9a

Browse files
committed
Merge branch 'development' of https://github.com/ArjixWasTaken/invaxion-server-emulator into development
2 parents d7d49fa + b3aa5b8 commit c247e9a

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

.github/scripts/get_version_tag.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import re
2+
3+
version_regex = r"Version>(\d+\.\d+\.\d+)<"
4+
5+
with open("Server/Server.csproj") as f:
6+
text = f.read()
7+
8+
version = re.findall(version_regex, text)
9+
version = "1.0.0" if not version else version[0]
10+
print(version)

.github/workflows/release.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and Deploy
22

33
env:
44
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
5-
release-action: whatever
5+
release-action: yes
66

77
on:
88
push:
@@ -12,6 +12,8 @@ on:
1212
- '*.md'
1313
- '.idea/*'
1414
- '.vs/*'
15+
- '*.yml'
16+
1517

1618
concurrency:
1719
group: "build-and-release"
@@ -22,7 +24,7 @@ jobs:
2224
name: Build and deploy
2325
runs-on: windows-latest
2426
steps:
25-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v3
2628

2729
- uses: actions/setup-dotnet@v2
2830
with:
@@ -31,15 +33,24 @@ jobs:
3133
- name: Setup NuGet
3234
uses: NuGet/[email protected]
3335

36+
- uses: actions/setup-python@v4
37+
with:
38+
python-version: '3.6.x'
39+
architecture: 'x64'
40+
3441
- name: Build
3542
run: dotnet publish -c=Release
43+
44+
- name: Set-tag-env
45+
run: |
46+
"RE_TAG_NAME=$(python .github/scripts/get_version_tag.py)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
3647
3748
- name: Publish the build
3849
uses: "marvinpinto/action-automatic-releases@latest"
3950
with:
40-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
41-
automatic_release_tag: "latest"
42-
prerelease: true
51+
repo_token: "${{ secrets.REPO_TOKEN }}"
52+
automatic_release_tag: "v${{ env.RE_TAG_NAME }}"
53+
prerelease: false
4354
title: "Automatic Build"
4455
files: |
4556
Server/bin/*/net35/ServerEmulator.dll

Server/Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>net35</TargetFramework>
44
<AssemblyName>ServerEmulator</AssemblyName>
55
<Description>INVAXION Server Emulator</Description>
6-
<Version>1.0.0</Version>
6+
<Version>1.0.2</Version>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<LangVersion>latest</LangVersion>
99
</PropertyGroup>

0 commit comments

Comments
 (0)