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

Merge 'release/6.6' into 'develop' #507

Merged
merged 7 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build

on:
push:
branches:
- develop
pull_request:
branches:
- master
- develop
- release/*

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./SourceCode/AgOpenGPS.sln

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Restore NuGet packages
run: nuget restore ${{env.SOLUTION_FILE_PATH}} -PackagesDirectory .\SourceCode\packages -source "https://api.nuget.org/v3/index.json"

- name: Build
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

- name: Create AgOpenGPS.zip
shell: powershell
run: Compress-Archive -Path "AgOpenGPS" -Destination "AgOpenGPS.zip"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: AgOpenGPS.zip
path: AgOpenGPS.zip
40 changes: 6 additions & 34 deletions .github/workflows/main.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ on:
push:
branches:
- master
- develop
pull_request:
branches:
- develop
- release/*
workflow_dispatch:

env:
# Path to the solution file relative to the root of the project.
Expand All @@ -19,11 +17,8 @@ env:
BUILD_CONFIGURATION: Release

jobs:
build:
build-and-release:
runs-on: windows-latest
outputs:
version: ${{ steps.variables.outputs.VERSION }}
prerelease: ${{ steps.variables.outputs.PRERELEASE }}

steps:
- name: Checkout
Expand All @@ -40,45 +35,22 @@ jobs:
- name: Build
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

- name: Set variables
id: variables
run: |
echo "VERSION=${{env.GitVersion_SemVer}}" >> $env:GITHUB_OUTPUT
echo "PRERELEASE=${{env.GitVersion_PreReleaseTag != ''}}" >> $env:GITHUB_OUTPUT

- name: Create AgOpenGPS.zip
shell: powershell
run: Compress-Archive -Path "AgOpenGPS" -Destination "AgOpenGPS.zip"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: AgOpenGPS.zip
path: AgOpenGPS.zip

release:
needs: build
runs-on: windows-latest
if: github.event_name != 'pull_request'

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: AgOpenGPS.zip

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.build.outputs.version }}
release_name: Release ${{ needs.build.outputs.version }}
tag_name: ${{ env.GitVersion_SemVer }}
release_name: Release ${{ env.GitVersion_SemVer }}
body: |
Automated Release by GitHub Action CI
draft: false
prerelease: ${{ needs.build.outputs.prerelease }}
prerelease: ${{ contains(github.ref_name, 'release/') }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
Expand Down
4 changes: 2 additions & 2 deletions SourceCode/AgIO/Source/Forms/Controls.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion SourceCode/AgIO/Source/Forms/FormCommPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void FormCommPicker_Load(object sender, EventArgs e)
private void cboxVeh_SelectedIndexChanged(object sender, EventArgs e)
{
var newname = cboxEnv.SelectedItem.ToString().Trim();
Properties.RegistrySettings.Save("ProfileFileName", newname);
Properties.RegistrySettings.Save("ProfileName", newname);
Properties.Settings.Default.Load();
DialogResult = DialogResult.OK;
}
Expand Down
10 changes: 5 additions & 5 deletions SourceCode/AgIO/Source/Forms/FormCommSaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public FormCommSaver(Form callingForm)

private void FormCommSaver_Load(object sender, EventArgs e)
{
lblLast.Text = "Current " + Properties.RegistrySettings.ProfileFileName;
lblLast.Text = "Current " + Properties.RegistrySettings.ProfileName;
DirectoryInfo dinfo = new DirectoryInfo(FormLoop.profileDirectory);
FileInfo[] Files = dinfo.GetFiles("*.xml");

Expand Down Expand Up @@ -48,10 +48,10 @@ private void cboxVeh_SelectedIndexChanged(object sender, EventArgs e)
{
var newname = cboxEnv.SelectedItem.ToString().Trim();

Properties.RegistrySettings.Save("ProfileFileName", newname);
Properties.RegistrySettings.Save("ProfileName", newname);
Properties.Settings.Default.Load();

if (Properties.RegistrySettings.ProfileFileName == "")
if (Properties.RegistrySettings.ProfileName == "")
{
mf.YesMessageBox("Default Profile, Changes will NOT be Saved");
}
Expand All @@ -72,9 +72,9 @@ private void btnSave_Click(object sender, EventArgs e)
{
if (tboxName.Text.Trim().Length > 0)
{
Properties.RegistrySettings.Save("ProfileFileName", tboxName.Text.ToString().Trim());
Properties.RegistrySettings.Save("ProfileName", tboxName.Text.ToString().Trim());

if (Properties.RegistrySettings.ProfileFileName != "")
if (Properties.RegistrySettings.ProfileName != "")
Properties.Settings.Default.Save();
else
mf.YesMessageBox("Default Profile, Changes will NOT be Saved");
Expand Down
6 changes: 3 additions & 3 deletions SourceCode/AgIO/Source/Forms/FormLoop.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AgIO.Logging;
using AgIO.Logging;
using AgIO.Properties;
using System;
using System.Diagnostics;
Expand Down Expand Up @@ -294,9 +294,9 @@ private void FormLoop_Load(object sender, EventArgs e)
Log.System.Write("Run GPS_Out");
}

this.Text = "AgIO v" + GitVersionInformation.MajorMinorPatch + " Profile: " + RegistrySettings.ProfileFileName;
this.Text = "AgIO v" + GitVersionInformation.MajorMinorPatch + " Profile: " + RegistrySettings.ProfileName;

if (RegistrySettings.ProfileFileName == "")
if (RegistrySettings.ProfileName == "")
YesMessageBox("Using Default Profile" + "\r\n\r\n" + "Load Existing Profile or Save a New One !!!"
+ "\r\n\r\n" + "Changes will NOT be Saved");
}
Expand Down
32 changes: 16 additions & 16 deletions SourceCode/AgIO/Source/Properties/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ public static class RegistrySettings
{
public static string culture = "en";
public static string WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
public static string ProfileFileName = "";
public static string ProfileName = "";

public static void Load()
{
try
{
//opening the subkey
RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AgOpenGPS");
RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AgIO");

////create default keys if not existing
if (regKey == null)
{
RegistryKey Key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS");
RegistryKey Key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgIO");

//storing the values
Key.SetValue("Language", "en");
Key.SetValue("WorkingDirectory", "Default");
Key.SetValue("ProfileFileName", "");
Key.SetValue("ProfileName", "");

Key.Close();
}
Expand All @@ -44,9 +44,9 @@ public static void Load()
if (dir != null && dir.ToString() != "Default")
WorkingDirectory = dir.ToString();

object name = regKey.GetValue("ProfileFileName");
object name = regKey.GetValue("ProfileName");
if (name != null)
ProfileFileName = name.ToString();
ProfileName = name.ToString();

var lang = regKey.GetValue("Language");
if (lang != null)
Expand All @@ -70,10 +70,10 @@ public static void Save(string name, string value)
try
{
//adding or editing "Language" subkey to the "SOFTWARE" subkey
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS");
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgIO");

if (name == "ProfileFileName")
ProfileFileName = value;
if (name == "ProfileName")
ProfileName = value;

if (name == "Directory" && value == Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
key.SetValue(name, "Default");
Expand All @@ -94,11 +94,11 @@ public static void Reset()
try
{
//opening the subkey
RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AgOpenGPS");
RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AgIO");

regKey.SetValue("Language", "en");
regKey.SetValue("WorkingDirectory", "Default");
regKey.SetValue("ProfileFileName", "Default Profile");
regKey.SetValue("ProfileName", "Default Profile");

regKey.Close();
}
Expand Down Expand Up @@ -196,25 +196,25 @@ public static Settings Default

public bool Load()
{
string path = Path.Combine(FormLoop.profileDirectory, RegistrySettings.ProfileFileName + ".XML");
string path = Path.Combine(FormLoop.profileDirectory, RegistrySettings.ProfileName + ".XML");
if (!LoadXMLFile(path, this))
{
RegistrySettings.Save("ProfileFileName", "");
RegistrySettings.Save("ProfileName", "");
Log.System.Write("Profile Not Found, Loading Default");
return false;
}
else
{
Log.System.Write(RegistrySettings.ProfileFileName + ".XML" + " Loaded");
Log.System.Write(RegistrySettings.ProfileName + ".XML" + " Loaded");
}
return true;
}

public void Save()
{
string path = Path.Combine(FormLoop.profileDirectory, RegistrySettings.ProfileFileName + ".XML");
string path = Path.Combine(FormLoop.profileDirectory, RegistrySettings.ProfileName + ".XML");

if (RegistrySettings.ProfileFileName != "")
if (RegistrySettings.ProfileName != "")
SaveXMLFile(path, this);
}

Expand Down