Skip to content

Commit

Permalink
build: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Jan 18, 2024
1 parent 758246e commit 6ddb5f8
Show file tree
Hide file tree
Showing 12 changed files with 622 additions and 339 deletions.
148 changes: 146 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,90 @@
## https://github.com/alexkaratarakis/gitattributes/blob/master/CSharp.gitattributes
## Common
# Common settings that generally should always be used with your language specific settings

# Auto detect text files and perform LF normalization
* text=auto

#
# The above will handle all files NOT found below
#

# Documents
*.bibtex text diff=bibtex
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md text diff=markdown
*.mdx text diff=markdown
*.tex text diff=tex
*.adoc text
*.textile text
*.mustache text
*.csv text eol=crlf
*.tab text
*.tsv text
*.txt text
*.sql text
*.epub diff=astextplain

# Graphics
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.tif binary
*.tiff binary
*.ico binary
# SVG treated as text by default.
*.svg text
# If you want to treat it as binary,
# use the following line instead.
# *.svg binary
*.eps binary

# Scripts
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf
*.zsh text eol=lf
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf

# Serialisation
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text

# Archives
*.7z binary
*.gz binary
*.tar binary
*.tgz binary
*.zip binary

# Text files where line endings should be preserved
*.patch -text

#
# Exclude files from exporting
#

.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore


## CSharp
# Auto detect text files and perform LF normalization
* text=auto

Expand All @@ -9,4 +95,62 @@
*.csproj text eol=crlf


## Repository specific attributes
## Global/VisualStudio
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just comment the entries below and
# uncomment the group further below
###############################################################################

*.sln text eol=crlf
*.csproj text eol=crlf
*.vbproj text eol=crlf
*.vcxproj text eol=crlf
*.vcproj text eol=crlf
*.dbproj text eol=crlf
*.fsproj text eol=crlf
*.lsproj text eol=crlf
*.wixproj text eol=crlf
*.modelproj text eol=crlf
*.sqlproj text eol=crlf
*.wwaproj text eol=crlf

*.xproj text eol=crlf
*.props text eol=crlf
*.filters text eol=crlf
*.vcxitems text eol=crlf


#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

#*.xproj merge=binary
#*.props merge=binary
#*.filters merge=binary
#*.vcxitems merge=binary


## Global/VisualStudioCode
# Fix syntax highlighting on GitHub to allow comments
.vscode/*.json linguist-language=JSON-with-Comments
59 changes: 12 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,70 +7,35 @@ jobs:
build:
strategy:
matrix:
runtime:
- linux-arm
- linux-arm64
- linux-x64
- linux-musl-arm
- linux-musl-arm64
- linux-musl-x64
- osx-arm64
- osx-x64
- win-arm
- win-arm64
- win-x64
- win-x86
include:
- runs-on: ubuntu-latest
- runs-on: macos-latest
runtime: osx-x64
- runs-on: macos-latest
runtime: osx-arm64
runs-on: ubuntu-latest
- runtime: win-arm64
platform: arm64
- runtime: win-x64
platform: x64
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- run: |
dotnet build src/LipUI/LipUI.csproj -c Release -o bin \
--sc false -r ${{ matrix.runtime }} -p:DebugType=none \
-p:PublishSingleFile=true
dotnet build src/LipUI/LipUI.csproj -c Release -o bin -r ${{ matrix.runtime }} \
-p:DebugType=none -p:Platform=${{ matrix.platform }} -p:PublishSingleFile=true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: LipUI-${{ matrix.runtime }}-${{ github.sha }}
path: bin

format:
check-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x

- run: dotnet format --verify-no-changes src/LipUI

- run: dotnet format --verify-no-changes src/LipUI.Tests

test:
strategy:
matrix:
runs-on:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- run: |
dotnet test src/LipUI.Tests/LipUI.Tests.csproj
74 changes: 14 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,24 @@ jobs:
build:
strategy:
matrix:
runtime:
- linux-arm
- linux-arm64
- linux-x64
- linux-musl-arm
- linux-musl-arm64
- linux-musl-x64
- osx-arm64
- osx-x64
- win-arm
- win-arm64
- win-x64
- win-x86
include:
- runs-on: ubuntu-latest
- runs-on: macos-latest
runtime: osx-x64
- runs-on: macos-latest
runtime: osx-arm64
runs-on: ${{ matrix.runs-on }}
- runtime: win-arm64
platform: arm64
- runtime: win-x64
platform: x64
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v3
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- run: |
dotnet publish src/LipUI/LipUI.csproj -c Release -o bin \
--sc false -r ${{ matrix.runtime }} -p:DebugType=none \
-p:PublishSingleFile=true
dotnet build src/LipUI/LipUI.csproj -c Release -o bin -r ${{ matrix.runtime }} \
-p:DebugType=none -p:Platform=${{ matrix.platform }} -p:PublishSingleFile=true
- run: |
cp CHANGELOG.md LICENSE README.md bin
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: LipUI-${{ matrix.runtime }}-${{ github.sha }}
path: bin
Expand All @@ -56,55 +38,27 @@ jobs:
strategy:
matrix:
runtime:
- linux-arm
- linux-arm64
- linux-x64
- linux-musl-arm
- linux-musl-arm64
- linux-musl-x64
- osx-arm64
- osx-x64
- win-arm
- win-arm64
- win-x64
- win-x86
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: LipUI-${{ matrix.runtime }}-${{ github.sha }}
path: bin

- run: |
cp CHANGELOG.md LICENSE README.md bin/
- name: Pack artifact (Windows)
if: startsWith(matrix.runtime, 'win')
- name: Create archive
run: |
cd bin
zip -r ../LipUI-${{ matrix.runtime }}.zip *
cd ..
- name: Pack artifact (Linux & macOS)
if: startsWith(matrix.runtime, 'linux') || startsWith(matrix.runtime, 'osx')
run: |
cd bin
tar -czvf ../LipUI-${{ matrix.runtime }}.tar.gz *
cd ..
- name: Upload artifact to release (Windows)
if: startsWith(matrix.runtime, 'win')
uses: softprops/action-gh-release@v1
- uses: softprops/action-gh-release@v1
with:
append_body: true
files: |
LipUI-${{ matrix.runtime }}.zip
- name: Upload artifact to release (Linux & macOS)
if: startsWith(matrix.runtime, 'linux') || startsWith(matrix.runtime, 'osx')
uses: softprops/action-gh-release@v1
with:
append_body: true
files: |
LipUI-${{ matrix.runtime }}.tar.gz
Loading

0 comments on commit 6ddb5f8

Please sign in to comment.