Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

Commit 83d9196

Browse files
authored
automate nightly & release builds using github actions and fix #11 (#10)
* ci: add github actions ci * ci: upload build artifacts * ci: fix wrong branch name * ci: add artifact names * ci: refactor for easier portability * ci: simplify step * ci: automatically add build result to release * ci: use windows-2019 * fix: twinx and tiki are switched around #11 * ci: fix space in artifact name * ci: update update.xml on release * ci: refactor a bit and actually update & commit * ci: put path to FunkeySelector.exe * ci: attempt to debug * ci: try to push changes * ci: checkout default branch * ci: push to default branch * chore(update): update update.xml * ci: debug null error * chore(update): update update.xml * ci: set correct asset name * ci: use GITHUB_OUTPUT properly * chore(update): update update.xml * revert: "chore(update): update update.xml" This reverts commit 42888e6. * ci: set version in AssemblyInfo.cs * chore(update): update update.xml * chore(update): update update.xml * ci: get tag name properly * ci: run on every push & PR * ci: use action to get tag name * ci: run always on push * ci: fetch git tags * ci: unshallow using git fetch * ci: try using other action to get tag * ci: commit changes to AssemblyInfo.cs * ci: clarify commit message * ci: correct description * ci: get version from update.xml * ci: don't care about tags * chore(release): v3.0.7 * ci: add warning about unintended behavior * revert: changes from test releases --------- Co-authored-by: Github Actions Bot <>
1 parent 2d90348 commit 83d9196

3 files changed

Lines changed: 168 additions & 6 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Builds a .NET framework project
2+
name: Nightly builds
3+
4+
env:
5+
projectName: FunkeySelectorGUI
6+
projectFolder: FunkeySelector
7+
solutionFile: FunkeySelector.sln
8+
9+
on:
10+
workflow_dispatch:
11+
12+
push:
13+
branches-ignore:
14+
- "gh-pages"
15+
16+
pull_request:
17+
branches-ignore:
18+
- "gh-pages"
19+
20+
jobs:
21+
build:
22+
strategy:
23+
matrix:
24+
configuration: [ Debug, Release ]
25+
runs-on: windows-2019
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Setup MSBuild
31+
uses: microsoft/setup-msbuild@v1
32+
33+
- name: Setup NuGet
34+
uses: NuGet/setup-nuget@v1
35+
36+
- name: Restore Packages
37+
run: nuget restore ${{ env.solutionFile }}
38+
39+
- name: Get version from update.xml
40+
id: getVersion
41+
uses: mavrosxristoforos/get-xml-info@1.2.1
42+
with:
43+
xml-file: update.xml
44+
xpath: //update/@version
45+
46+
- name: Normalize the version string into SemVer format (x.x.x)
47+
id: normalizeVersion
48+
run: |
49+
$versionString = "${{ steps.getVersion.outputs.info }}"
50+
$digits = $versionString.Split(".").Length
51+
if ($digits -eq 1) { $versionString += ".0.0" }
52+
elseif ($digits -eq 2) { $versionString += ".0" }
53+
"VERSION=$($versionString)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
54+
55+
- name: Set version in AssemblyInfo.cs
56+
uses: secondbounce/assemblyinfo-update@v2
57+
with:
58+
version: "${{ steps.normalizeVersion.outputs.VERSION }}"
59+
60+
- name: Build solution
61+
run: msbuild ${{ env.solutionFile }} -t:rebuild -property:Configuration=${{ matrix.configuration }}
62+
63+
- name: Upload the build results as an artifact
64+
uses: actions/upload-artifact@v3
65+
with:
66+
path: ${{ env.projectFolder }}/bin/${{ matrix.configuration }}/*
67+
name: ${{ env.projectName }}.Nightly.${{ matrix.configuration }}

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Builds a .NET framework project in Release mode when a new release is created
2+
# and uploads the build results to the newly created release
3+
# then updates update.xml and Properties/AssemblyInfo.cs
4+
name: Publish release
5+
6+
env:
7+
projectName: FunkeySelectorGUI
8+
projectFolder: FunkeySelector
9+
solutionFile: FunkeySelector.sln
10+
11+
on:
12+
release:
13+
types:
14+
- released
15+
16+
jobs:
17+
publish:
18+
permissions:
19+
contents: write
20+
id-token: write
21+
strategy:
22+
matrix: # please please please don't put multiple build configurations in here, it will cause unintended behaviour
23+
configuration: [ Release ]
24+
runs-on: windows-2019
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
ref: "${{ github.event.repository.default_branch }}"
30+
31+
- name: Setup git configuration
32+
run: |
33+
git config user.name "Github Actions Bot"
34+
git config user.email "<>"
35+
36+
- name: Setup MSBuild
37+
uses: microsoft/setup-msbuild@v1
38+
39+
- name: Setup NuGet
40+
uses: NuGet/setup-nuget@v1
41+
42+
- name: Restore Packages
43+
run: nuget restore ${{ env.solutionFile }}
44+
45+
- name: Get version from release name
46+
id: version
47+
uses: mad9000/actions-find-and-replace-string@4
48+
with:
49+
source: "${{ github.event.release.tag_name }}"
50+
find: "v"
51+
replace: ""
52+
53+
- name: Normalize the version string into SemVer format (x.x.x)
54+
id: normalizeVersion
55+
run: |
56+
$versionString = "${{ steps.version.outputs.value }}"
57+
$digits = $versionString.Split(".").Length
58+
if ($digits -eq 1) { $versionString += ".0.0" }
59+
elseif ($digits -eq 2) { $versionString += ".0" }
60+
"VERSION=$($versionString)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
61+
62+
- name: Set version in AssemblyInfo.cs
63+
uses: secondbounce/assemblyinfo-update@v2
64+
with:
65+
version: "${{ steps.normalizeVersion.outputs.VERSION }}"
66+
67+
- name: Build solution
68+
run: msbuild ${{ env.solutionFile }} -t:rebuild -property:Configuration=${{ matrix.configuration }}
69+
70+
- name: Upload the build results as an artifact
71+
uses: actions/upload-artifact@v3
72+
with:
73+
path: ${{ env.projectFolder }}/bin/${{ matrix.configuration }}/*
74+
name: ${{ env.projectName }}.${{ github.event.release.tag_name }}.${{ matrix.configuration }}
75+
76+
- name: Upload build results to release
77+
uses: svenstaro/upload-release-action@v2
78+
with:
79+
file: ${{ env.projectFolder }}/bin/${{ matrix.configuration }}/FunkeySelector.exe
80+
asset_name: FunkeySelectorGUI.exe
81+
82+
- name: Get file size of FunkeySelectorGUI.exe
83+
id: filesize
84+
run: |
85+
"FILESIZE=$((Get-Item ${{ env.projectFolder }}/bin/${{ matrix.configuration }}/FunkeySelector.exe).length)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
86+
87+
- name: Update update.xml
88+
run: echo '<update version="${{ steps.version.outputs.value }}" name="${{ github.event.release.name }}" size="${{ steps.filesize.outputs.FILESIZE }}" url="https://github.com/GittyMac/FunkeySelectorGUI/releases/download/${{ github.event.release.tag_name }}/FunkeySelectorGUI.exe" />' > update.xml
89+
90+
- name: Push the changes made to update.xml
91+
run: |
92+
git add update.xml
93+
git add ${{ env.projectFolder }}/Properties/AssemblyInfo.cs
94+
git commit -m "chore(release): ${{ github.event.release.tag_name }}"
95+
git push origin ${{ github.event.repository.default_branch }}

FunkeySelector/KelpyBasin.Designer.cs

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)