Skip to content
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
61 changes: 61 additions & 0 deletions .github/workflows/nuget_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish to nuget

on:
push:
branches:
- master
paths:
- "**/*.cs"
- "**/*.csproj"

jobs:

nuget_publish:
name: Build, pack and nuget publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x

- name: Launch unit tests
run: dotnet test --nologo

- name: NuGet publish
id: nuget_worker
uses: alirezanet/publish-nuget@v3.1.0
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: SQLCipherED/SQLCipherED.csproj

# NuGet package id, used for version detection & defaults to project name
# PACKAGE_NAME: AesIge

# Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH
# VERSION_FILE_PATH: Directory.Build.props

# Regex pattern to extract version info in a capturing group
# Version>([\d]+(.[\d]+)*)<\/\w*Version>$ - NET Core csproj regex
VERSION_REGEX: Version>([\d]+(.[\d]+)*)<\/\w*Version>$

# Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX
# VERSION_STATIC: 1.0.0

# Flag to toggle git tagging, enabled by default
TAG_COMMIT: false

# Format of the git tag, [*] gets replaced with actual version
# TAG_FORMAT: v*

# API key to authenticate with NuGet server
NUGET_KEY: ${{secrets.NUGET_API_KEY}}

# NuGet server uri hosting the packages, defaults to https://api.nuget.org
# NUGET_SOURCE: https://api.nuget.org

# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
INCLUDE_SYMBOLS: false
4 changes: 2 additions & 2 deletions .github/workflows/pr_unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.x'
- name: Launch tests
Expand Down
161 changes: 115 additions & 46 deletions .github/workflows/release_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@ jobs:
unit_tests:
name: Unit tests
runs-on: ubuntu-latest
outputs:
release_ver: ${{ steps.lib_proj_version.outputs.assembly-version }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.x'

- name: Parse lib csproj version
id: lib_proj_version
uses: kzrnm/get-net-sdk-project-versions-action@v2
with:
proj-path: SQLCipherED/SQLCipherED.csproj

- name: Launch tests
run: dotnet test --nologo

Expand All @@ -34,31 +43,22 @@ jobs:
env:
BUILD_ARCH: win-x64
BUILD_DIR: ./build/SQLCipherED.UI/Release/net6.0/win-x64
BUILD_ARTIFACTS: SQLCipherED.dll runner-sqlcipher-ed.dll runner-sqlcipher-ed.exe runner-sqlcipher-ed.runtimeconfig.json
ZIP_FILE: sqlcipher-ed_win-x64.zip
outputs:
release_ver: ${{ steps.app_proj_version.outputs.assembly-version }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.x'

- name: Parse app csproj version
id: app_proj_version
uses: kzrnm/get-net-sdk-project-versions-action@v1
with:
proj-path: SQLCipherED.UI/SQLCipherED.UI.csproj

- name: Build CLI app
run: dotnet build SQLCipherED.UI/SQLCipherED.UI.csproj -r ${{env.BUILD_ARCH}} -c Release
run: dotnet build SQLCipherED.UI/SQLCipherED.UI.csproj -r ${{env.BUILD_ARCH}} -c Release --self-contained

- name: Zip build
run: cd ${{env.BUILD_DIR}} && zip ${{env.ZIP_FILE}} ${{env.BUILD_ARTIFACTS}}
run: cd ${{env.BUILD_DIR}} && zip ${{env.ZIP_FILE}} ./

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v6
with:
name: app_${{env.BUILD_ARCH}}
path: ${{env.BUILD_DIR}}/${{env.ZIP_FILE}}
Expand All @@ -70,23 +70,22 @@ jobs:
env:
BUILD_ARCH: win-x86
BUILD_DIR: ./build/SQLCipherED.UI/Release/net6.0/win-x86
BUILD_ARTIFACTS: SQLCipherED.dll runner-sqlcipher-ed.dll runner-sqlcipher-ed.exe runner-sqlcipher-ed.runtimeconfig.json
ZIP_FILE: sqlcipher-ed_win-x86.zip

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.x'

- name: Build CLI app
run: dotnet build SQLCipherED.UI/SQLCipherED.UI.csproj -r ${{env.BUILD_ARCH}} -c Release
run: dotnet build SQLCipherED.UI/SQLCipherED.UI.csproj -r ${{env.BUILD_ARCH}} -c Release --self-contained

- name: Zip build
run: cd ${{env.BUILD_DIR}} && zip ${{env.ZIP_FILE}} ${{env.BUILD_ARTIFACTS}}
run: cd ${{env.BUILD_DIR}} && zip ${{env.ZIP_FILE}} ./

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v6
with:
name: app_${{env.BUILD_ARCH}}
path: ${{env.BUILD_DIR}}/${{env.ZIP_FILE}}
Expand All @@ -98,66 +97,88 @@ jobs:
env:
BUILD_ARCH: linux-x64
BUILD_DIR: ./build/SQLCipherED.UI/Release/net6.0/linux-x64
#BUILD_ARTIFACTS: SQLCipherED.so runner-sqlcipher-ed.so runner-sqlcipher-ed runner-sqlcipher-ed.runtimeconfig.json
BUILD_ARTIFACTS: SQLCipherED.dll runner-sqlcipher-ed.dll runner-sqlcipher-ed runner-sqlcipher-ed.runtimeconfig.json
ZIP_FILE: sqlcipher-ed_linux-x64.zip

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.x'

- name: Build CLI app
run: dotnet build SQLCipherED.UI/SQLCipherED.UI.csproj -r ${{env.BUILD_ARCH}} -c Release

run: dotnet build SQLCipherED.UI/SQLCipherED.UI.csproj -r ${{env.BUILD_ARCH}} -c Release --self-contained
- name: Zip build
run: cd ${{env.BUILD_DIR}} && zip ${{env.ZIP_FILE}} ${{env.BUILD_ARTIFACTS}}
run: cd ${{env.BUILD_DIR}} && zip ${{env.ZIP_FILE}} ./

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v6
with:
name: app_${{env.BUILD_ARCH}}
path: ${{env.BUILD_DIR}}/${{env.ZIP_FILE}}

build_nuget:
name: Build NuGet package
needs: unit_tests
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.unit_tests.outputs.release_ver }}
BUILD_DIR: ./build/SQLCipherED/Release

steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x

- name: Release build
run: dotnet build SQLCipherED/SQLCipherED.csproj -c Release

- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: nuget_artifact
path: ${{ env.BUILD_DIR }}/SQLCipherED.${{ env.RELEASE_VERSION }}.nupkg

github_release_draft:
name: Make Github release draft
needs:
- unit_tests
- build_win_x64
- build_win_x86
- build_linux_x64
- build_nuget
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }}
RELEASE_VERSION: ${{ needs.build_win_x64.outputs.release_ver }}
RELEASE_VERSION: ${{ needs.unit_tests.outputs.release_ver }}
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
runs-on: ubuntu-latest

steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}
name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}
draft: true

github_upload_release_artifacts:
name: Upload build artifacts to GIthub release
github_upload_win_x64:
name: Upload Windows x64 build artifact to Github release
needs:
- unit_tests
- github_release_draft
- build_win_x64
- build_win_x86
- build_linux_x64
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }}
RELEASE_VERSION: ${{ needs.build_win_x64.outputs.release_ver }}
UPLOAD_URL: ${{ needs.github_release_draft.outputs.upload_url }}
runs-on: ubuntu-latest

steps:
- name: Download win-x64 artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: app_win-x64

Expand All @@ -166,11 +187,22 @@ jobs:
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: sqlcipher-ed_win-x64.zip
asset_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}_win-x64.zip
asset_name: ${{ github.event.repository.name }}_win-x64.zip
asset_content_type: application/zip


github_upload_win_x86:
name: Upload Windows x86 build artifact to Github release
needs:
- unit_tests
- github_release_draft
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }}
UPLOAD_URL: ${{ needs.github_release_draft.outputs.upload_url }}
runs-on: ubuntu-latest

steps:
- name: Download win-x86 artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: app_win-x86

Expand All @@ -179,11 +211,23 @@ jobs:
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: sqlcipher-ed_win-x86.zip
asset_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}_win-x86.zip
asset_name: ${{ github.event.repository.name }}_win-x86.zip
asset_content_type: application/zip


github_upload_linux_x64:
name: Upload Linux x64 build artifacts (self-contained, AppImage) to Github release
needs:
- unit_tests
- github_release_draft
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }}
RELEASE_VERSION: ${{ needs.unit_tests.outputs.release_ver }}
UPLOAD_URL: ${{ needs.github_release_draft.outputs.upload_url }}
runs-on: ubuntu-latest

steps:
- name: Download linux-x64 artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: app_linux-x64

Expand All @@ -193,4 +237,29 @@ jobs:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: sqlcipher-ed_linux-x64.zip
asset_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}_linux-x64.zip
asset_content_type: application/zip

github_upload_nuget:
name: Upload NuGet build artifact to Github release
needs:
- unit_tests
- github_release_draft
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }}
RELEASE_VERSION: ${{ needs.unit_tests.outputs.release_ver }}
UPLOAD_URL: ${{ needs.github_release_draft.outputs.upload_url }}
runs-on: ubuntu-latest

steps:
- name: Download NuGet artifact
uses: actions/download-artifact@v7
with:
name: nuget_artifact

- name: Upload NuGet artifact to release assets
uses: actions/upload-release-asset@v1.0.1
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: SQLCipherED.${{ env.RELEASE_VERSION }}.nupkg
asset_name: SQLCipherED.${{ env.RELEASE_VERSION }}.nupkg
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 SQLCipherED
Copyright (c) 2023-2026 mIwr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 5 additions & 0 deletions SQLCipherED.Tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<BaseIntermediateOutputPath>../build/$(MSBuildProjectName)/obj/</BaseIntermediateOutputPath>
</PropertyGroup>
</Project>
18 changes: 1 addition & 17 deletions SQLCipherED.Tests/SQLCipherED.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,7 @@

<BaseOutputPath>../build/SQLCipherED.Tests</BaseOutputPath>

<Platforms>x64;x86</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<WarningLevel>7</WarningLevel>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<WarningLevel>7</WarningLevel>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<WarningLevel>7</WarningLevel>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<WarningLevel>7</WarningLevel>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading
Loading