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
20 changes: 20 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "1.0.0",
"commands": [
"csharpier"
],
"rollForward": false
},
"nbgv": {
"version": "3.7.115",
"commands": [
"nbgv"
],
"rollForward": false
}
}
}
1 change: 1 addition & 0 deletions .csharpierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
printWidth: 160
303 changes: 303 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

145 changes: 21 additions & 124 deletions .github/workflows/dotnet-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,144 +4,41 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: [opened, synchronize, reopened]

jobs:
linux-mac:
runs-on: ubuntu-latest
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
build:
runs-on: windows-latest
steps:

- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- uses: actions/checkout@v4
with:
dotnet-version: 3.1.101

- name: Build
working-directory: ./src
run: dotnet build --configuration Release
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: Build LinuxX64 EXE
working-directory: ./src
run: dotnet publish -p:PublishProfile=LinuxX64 --configuration Release

- name: Build MacOsx64 EXE
working-directory: ./src
run: dotnet publish -p:PublishProfile=MacOsx64 --configuration Release

- name: Zip LinuxX64 EXE
uses: thedoctor0/zip-release@master
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
filename: 'Coveo.Connectors.EasyFilePusher_LinuxX64.zip'
directory: './bin/Release/netcoreapp3.1/publish/LinuxX64'
exclusions: '*.pdb'
type: zip
dotnet-version: 8

- name: Zip MacOsx64 EXE
uses: thedoctor0/zip-release@master
with:
filename: 'Coveo.Connectors.EasyFilePusher_MacOsx64.zip'
directory: './bin/Release/netcoreapp3.1/publish/MacOsx64'
exclusions: '*.pdb'
type: zip
- name: Restore tools
run: dotnet tool restore

- name: Delete existing release
if: ${{ github.event_name == 'push' }}
uses: ame-yu/action-delete-latest-release@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create release
if: ${{ github.event_name == 'push' }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: latest
release_name: Latest Release
draft: false
prerelease: false
- name: Create variables for version
id: nbgv
shell: bash
run: echo "SemVer2=$(dotnet nbgv get-version --variable NuGetPackageVersion)" >> $GITHUB_OUTPUT

- name: Release Linux executable
if: ${{ github.event_name == 'push' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/Release/netcoreapp3.1/publish/LinuxX64/Coveo.Connectors.EasyFilePusher_LinuxX64.zip
asset_name: Coveo.Connectors.EasyFilePusher_LinuxX64.zip
asset_content_type: application/zip

- name: Release Mac executable
if: ${{ github.event_name == 'push' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/Release/netcoreapp3.1/publish/MacOsx64/Coveo.Connectors.EasyFilePusher_MacOsx64.zip
asset_name: Coveo.Connectors.EasyFilePusher_MacOsx64.zip
asset_content_type: application/zip

windows:
needs: linux-mac
runs-on: windows-latest
steps:

- uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Verify variable
run: echo "SemVer2=${{ steps.nbgv.outputs.SemVer2 }}"

- name: Build
working-directory: ./src
run: dotnet build --configuration Release

- name: Build WinX86 EXE
working-directory: ./src
run: dotnet publish -p:PublishProfile=WinX86 --configuration Release

- name: Prepare Windows certificate 1/2
id: write_pem_file
uses: timheuer/base64-to-file@v1
with:
fileName: 'cert.pem'
encodedString: ${{ secrets.WINDOWS_CERT }}

- name: Prepare Windows certificate 2/2
working-directory: .
run: 'CMD /r openssl pkcs12 -in ${{ steps.write_pem_file.outputs.filePath }} -export -out cert.pfx -passin pass:"${{ secrets.WINDOWS_CERT_PWD }}" -passout pass:"${{ secrets.WINDOWS_CERT_PWD }}"'

- name: Sign Windows executable
working-directory: .
run: 'CMD /r "C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe" sign /f cert.pfx /p ${{ secrets.WINDOWS_CERT_PWD }} bin\Release\netcoreapp3.1\publish\WinX86\Coveo.Connectors.EasyFilePusher.exe'

- name: Delete Windows temp certificate 1/2
working-directory: .
run: 'DEL cert.pfx'

- name: Delete Windows temp certificate 2/2
working-directory: .
run: 'DEL ${{ steps.write_pem_file.outputs.filePath }}'

- name: Zip WinX86 EXE
working-directory: .
run: 'Compress-Archive bin\Release\netcoreapp3.1\publish\WinX86\Coveo.Connectors.EasyFilePusher.exe bin\Release\netcoreapp3.1\publish\WinX86\Coveo.Connectors.EasyFilePusher_WinX86.zip'

- name: Release Windows executable
# Publish Github Release
- name: Create release
if: ${{ github.event_name == 'push' }}
uses: actions/upload-release-asset@v1
working-directory: .
run: gh release create v${{ steps.nbgv.outputs.SemVer2 }} --generate-notes --target $GITHUB_SHA
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.linux-mac.outputs.release_upload_url }}
asset_path: ./bin/Release/netcoreapp3.1/publish/WinX86/Coveo.Connectors.EasyFilePusher_WinX86.zip
asset_name: Coveo.Connectors.EasyFilePusher_WinX86.zip
asset_content_type: application/zip
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[Bb]in/
.nuget/
.vs/
.vscode/
_ReSharper.*
packages/
artifacts/
Expand Down
20 changes: 10 additions & 10 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
<Project>
<!-- NuGet properties. -->
<PropertyGroup>
<Version>0.0.1</Version>
<Version>1.0.0</Version>

<Company>Coveo Solutions Inc.</Company>
<Authors>Coveo Solutions Inc.</Authors>
<Product>Easy File Pusher</Product>

<PackageIcon>icon.png</PackageIcon>

<!-- Deprecated but needed for backward compatiblity. -->
<PackageIconUrl>icon.png</PackageIconUrl>

<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Copyright>Copyright © Coveo Solutions Inc</Copyright>
<IncludeSymbols>true</IncludeSymbols>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<OutputPath>..\..\bin\Debug</OutputPath>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\..\bin\Release</OutputPath>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath=""/>
</ItemGroup>

</Project>
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

The Coveo Easy File Pusher is a command-line tool that pushes items stored in a local file system to a Coveo Push source. To use the Easy File Pusher, you must first [create a Push source using the Coveo Administration Console](https://docs.coveo.com/en/1546/). Then, run the tool to scan the specified local folder and push the files matching the specified filter.

## Compile the Easy File Pusher

Having the .Net 8 SDK is necessary for compiling the tool. See here for downloads applicable to your operating system: [https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0).

First navigate in your terminal to the `src` folder.

- Run one of the following commands:
- Windows: `dotnet publish -p:PublishProfile=WinX86 --configuration Release`
- Linux: `dotnet publish -p:PublishProfile=LinuxX64 --configuration Release`
- Mac: `dotnet publish -p:PublishProfile=MacOsx64 --configuration Release`

The compiled executable will be found in `src/publish`.

## Configure the Easy File Pusher

There are two ways to provide the configuration values to the tool:
Expand All @@ -15,9 +28,9 @@ There are two ways to provide the configuration values to the tool:
Running the tool with the `--help` argument displays the arguments that can be specified on the command line:

```
-e, --environment Required. Cloud environment: Hipaa, Prod, QA or Dev.
-e, --environment Required. Cloud environment: Hipaa or Prod.

-r, --region Required. Cloud region: UsEast1 or EuWest1.
-r, --region Required. Cloud region: UsEast1, EuWest1, ApSouthEast2 or CaCentral1.

-o, --organizationid Required. ID of the organization in which to push documents.

Expand Down Expand Up @@ -54,9 +67,9 @@ Alternatively, if you choose to launch the tool without any argument, it will th

## Supported Operating Systems

Since the tool was developed using .NET Core, it can be executed on the operating systems supported by .NET Core, i.e., Windows, macOS, and Linux. An executable for each supported operating system is available for download.
Since the tool was developed using .NET 8, it can be executed on the operating systems supported by .NET 8, i.e., Windows, macOS, and Linux.

Note that the macOS executable has not been signed with a certificate. As a result, running it requires a minor adjustment to work around a security warning:
Note that the macOS executable has not been signed with a certificate. If you get a security warning when running it, you might have to do a minor adjustment:

1. Unzip the executable file.
2. Control-click (or right-click) the file > **Open**/**Open with** > **Utilities** > **Terminal**. If **Terminal** isn't available, change **Enable: Recommended Applications** to **Enable: All Applications**.
Expand Down
Loading