Skip to content

Commit

Permalink
👷 Elegant CI
Browse files Browse the repository at this point in the history
  • Loading branch information
SydneyOwl committed Apr 1, 2024
1 parent 2df3f1a commit cefff29
Show file tree
Hide file tree
Showing 22 changed files with 730 additions and 391 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Senhaix Build

permissions:
contents: write

on:
push:
branches: [ "master" ]
tags: [ "*" ]
pull_request:
branches: [ "master" ]

jobs:

build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'

# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Build the application
shell: pwsh
run: |
mkdir tmp
Set-TimeZone -Name "China Standard Time"
$commitHash = git rev-parse --short HEAD
$buildTime = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$tagName = git describe --tags --abbrev=0 --always || ""
cd GT12\HID
$sourceFile = "./VERSION.cs"
(Get-Content $sourceFile) `
-replace '@COMMIT_HASH@', $commitHash `
-replace '@BUILD_TIME@', $buildTime `
-replace '@TAG_NAME@', $tagName `
| Set-Content $sourceFile
cd ..
msbuild /t:Restore
msbuild
cd bin\Debug\net462
mkdir -Force lib
mkdir GT12-Freq-Writer
mv *.dll lib
mv lib GT12-Freq-Writer
mv *.exe GT12-Freq-Writer
mv *.config GT12-Freq-Writer
mv *.pdb GT12-Freq-Writer
cp D:\a\senhaix-freq-writer-enhanced\senhaix-freq-writer-enhanced\data\satellite_data\data\amsat-all-frequencies.json GT12-Freq-Writer
Compress-Archive -Path .\GT12-Freq-Writer -DestinationPath ..\..\..\..\tmp\GT12-Freq-Writer-${tagName}.zip
cd ..\..\..\..\shx8x00\SQ5R.Properties
$sourceFile = "./VERSION.cs"
(Get-Content $sourceFile) `
-replace '@COMMIT_HASH@', $commitHash `
-replace '@BUILD_TIME@', $buildTime `
-replace '@TAG_NAME@', $tagName `
| Set-Content $sourceFile
cd ..
msbuild SHX8800.csproj /t:Restore
msbuild SHX8800.csproj
msbuild SHX8800_nobt.csproj /t:Restore
msbuild SHX8800_nobt.csproj
cd bin\Debug\net462
mkdir -Force lib
mkdir Shx8x00-Freq-Writer-With-Bluetooth
mv *.dll lib
mv lib Shx8x00-Freq-Writer-With-Bluetooth
mv *.exe Shx8x00-Freq-Writer-With-Bluetooth
mv *.config Shx8x00-Freq-Writer-With-Bluetooth
mv *.pdb Shx8x00-Freq-Writer-With-Bluetooth
cp D:\a\senhaix-freq-writer-enhanced\senhaix-freq-writer-enhanced\data\satellite_data\data\amsat-all-frequencies.json Shx8x00-Freq-Writer-With-Bluetooth
Compress-Archive -Path .\Shx8x00-Freq-Writer-With-Bluetooth -DestinationPath ..\..\..\..\tmp\Shx8x00-Freq-Writer-With-Bluetooth-${tagName}.zip
cd ..\net20
mkdir -Force lib
mkdir Shx8x00-Freq-Writer
mv *.dll lib
mv lib Shx8x00-Freq-Writer
mv *.exe Shx8x00-Freq-Writer
mv *.config Shx8x00-Freq-Writer
mv *.pdb Shx8x00-Freq-Writer
cp D:\a\senhaix-freq-writer-enhanced\senhaix-freq-writer-enhanced\data\satellite_data\data\amsat-all-frequencies.json Shx8x00-Freq-Writer
Compress-Archive -Path .\Shx8x00-Freq-Writer -DestinationPath ..\..\..\..\tmp\Shx8x00-Freq-Writer-${tagName}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: entire-folder-artifact
path: ./tmp # 替换为你要上传的文件夹路径

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./tmp/*
29 changes: 0 additions & 29 deletions .github/workflows/gt12.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/shx8x00.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/shx8x00_nobt.yml

This file was deleted.

8 changes: 8 additions & 0 deletions GT12/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<publisherPolicy apply="yes"/>
<probing privatePath="lib"/>
</assemblyBinding>
</runtime>
</configuration>
8 changes: 8 additions & 0 deletions GT12/HID/VERSION.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace HID;

public class VERSION
{
public static string GitCommitHash = "@COMMIT_HASH@";
public static string BuildTime = "@BUILD_TIME@";
public static string Version = "@TAG_NAME@";
}
5 changes: 0 additions & 5 deletions GT12/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
using System.Runtime.Versioning;

[assembly: AssemblyTitle("SHX-GT12 CPS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SHX-GT12 CPS")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a8381aea-8dc4-43a5-9de5-f6bc6d2c2de5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Expand Down
5 changes: 5 additions & 0 deletions GT12/SHX-GT12-CPS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@
<HintPath>.\DevComponents.DotNetBar2.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Update="SHX_GT12_CPS\FormAbout.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project>
30 changes: 0 additions & 30 deletions GT12/SHX_GT12_CPS.FormAbout.resx

This file was deleted.

Loading

0 comments on commit cefff29

Please sign in to comment.