Skip to content

Commit

Permalink
Initial commit, v1
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-s committed Feb 18, 2021
0 parents commit 59b9df9
Show file tree
Hide file tree
Showing 24 changed files with 1,972 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
*.cs diff=csharp

###############################################################################
# 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 uncomment the entries below
###############################################################################
#*.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

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.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
29 changes: 29 additions & 0 deletions .github/workflows/CIBuildTest-Linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: BuildAndTest-Linux

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
BuildAndTest:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Build
working-directory: src
run: dotnet build

- name: Test
working-directory: src
run: 'dotnet test --no-build --verbosity normal --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Class;FailureBodyFormat=Verbose"'
40 changes: 40 additions & 0 deletions .github/workflows/CIBuildTest-Win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: BuildAndTest-Windows

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
BuildAndTest:
runs-on: windows-latest
env:
DOTNET_NOLOGO: true

steps:
- uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Build
working-directory: src
run: dotnet build

- name: Test
working-directory: src
run: 'dotnet test --no-build --verbosity normal --test-adapter-path:. --logger:"junit;LogFilePath=../artifacts/{assembly}-test-result.xml;MethodFormat=Class;FailureBodyFormat=Verbose"'

- name: Publish Unit Test Results
uses: zyborg/dotnet-tests-report@v1.3.0
with:
project_path: ./src/QnapBackupDecryptor.Core.Tests
report_name: QnapBackupDecryptor.Core.Tests
report_title: QnapBackupDecryptor.Core.Tests
github_token: ${{ secrets.GITHUB_TOKEN }}
gist_name: QnapBackupDecryptor.Core.Tests.md
gist_badge_label: "QnapBackupDecryptor.Core: %Counters_passed%/%Counters_total%"
gist_token: ${{ secrets.GIST_TOKEN }}
95 changes: 95 additions & 0 deletions .github/workflows/ReleaseAll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: ReleaseAll

on:
release:
types: [published]

jobs:
release:
name: Release
strategy:
matrix:
kind: ["linux", "windows", "macOS"]
include:
- kind: linux
os: ubuntu-latest
target: linux-x64
- kind: windows
os: windows-latest
target: win-x64
- kind: macOS
os: macos-latest
target: osx-x64
runs-on: ${{ matrix.os }}
env:
DOTNET_NOLOGO: true
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: BuildFrameworkDep
shell: bash
working-directory: src
run: |
tag=$(git describe --tags --abbrev=0)
release_name="QnapBackupDecryptor-FD-$tag-${{ matrix.target }}"
# Build everything
dotnet publish ./QnapBackupDecryptor.Console/QnapBackupDecryptor.Console.csproj -c Release -f net5.0 -r ${{ matrix.target }} --self-contained false -p:PublishSingleFile=true -o "./releases/$release_name"
# bin the pdb files
rm ./releases/$release_name/*.pdb
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
# Pack to zip for Windows
mv ./releases/$release_name/QnapBackupDecryptor.Console.exe ./releases/$release_name/QnapBackupDecryptor.exe
7z a -tzip "../${release_name}.zip" "./releases/${release_name}/*"
else
mv ./releases/$release_name/QnapBackupDecryptor.Console ./releases/$release_name/QnapBackupDecryptor
tar czvf "../${release_name}.tar.gz" "./releases/$release_name"
fi
# Delete output directory
rm -r "./releases/$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "QnapBackupDecryptor-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: BuildSelfContained
shell: bash
working-directory: src
run: |
tag=$(git describe --tags --abbrev=0)
release_name="QnapBackupDecryptor-SC-$tag-${{ matrix.target }}"
# Build everything
dotnet publish QnapBackupDecryptor.sln -c Release -f net5.0 -r ${{ matrix.target }} --self-contained true -o "./releases/$release_name"
# bin the pdb files
rm ./releases/$release_name/*.pdb
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
# Pack to zip for Windows
7z a -tzip "../${release_name}.zip" "./releases/${release_name}/*"
else
tar czvf "../${release_name}.tar.gz" "./releases/$release_name"
fi
# Delete output directory
rm -r "./releases/$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "QnapBackupDecryptor-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '43 9 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Loading

0 comments on commit 59b9df9

Please sign in to comment.