Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 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
172 changes: 70 additions & 102 deletions .github/workflows/dotnet-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,145 +3,113 @@ name: Publish the Easy File Pusher tool.
on:
push:
branches: [ master ]
# Just testing for the PR.
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 }}
linux-mac-windows:
runs-on: windows-latest
steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

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

- name: Restore tools
run: dotnet tool restore

- name: Create variables for version
id: nbgv
shell: bash
run: echo "SemVer2=$(dotnet nbgv get-version --variable NuGetPackageVersion)" >> $GITHUB_OUTPUT

- name: Verify variable
run: echo "SemVer2=${{ steps.nbgv.outputs.SemVer2 }}"

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

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

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

- name: Zip LinuxX64 EXE
uses: thedoctor0/zip-release@master
with:
filename: 'Coveo.Connectors.EasyFilePusher_LinuxX64.zip'
directory: './bin/Release/netcoreapp3.1/publish/LinuxX64'
exclusions: '*.pdb'
type: zip

- 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: 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: 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: Build
shell: powershell
run: |
dotnet publish -p:PublishProfile=LinuxX64 --configuration Release
$files=Get-ChildItem -Path ./../bin/Release/netcoreapp3.1/publish/LinuxX64 -Exclude *.pdb
echo ${files}
$compress = @{
Path = $files
CompressionLevel = "Fastest"
DestinationPath = "./../publish/Coveo.Connectors.EasyFilePusher_LinuxX64.zip"
}
Compress-Archive @compress

- name: Create MacOsx64 Zip
working-directory: ./src
run: dotnet build --configuration Release
shell: powershell
run: |
dotnet publish -p:PublishProfile=MacOsx64 --configuration Release
$files=Get-ChildItem -Path ./../bin/Release/netcoreapp3.1/publish/MacOsx64 -Exclude *.pdb
echo ${files}
$compress = @{
Path = $files
CompressionLevel = "Fastest"
DestinationPath = "./../publish/Coveo.Connectors.EasyFilePusher_MacOsx64.zip"
}
Compress-Archive @compress

- 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 }}
shell: bash
run: |
# Decode the certificate and write it to a file
echo "${{ secrets.WINDOWS_CERT }}" | base64 --decode > cert.pem
ls

- 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 }}"'
run: |
CMD /r openssl pkcs12 -in cert.pem -export -out cert.pfx -passin pass:"${{ secrets.WINDOWS_CERT_PWD }}" -passout pass:"${{ secrets.WINDOWS_CERT_PWD }}"
ls

- 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'
shell: powershell
run: |
& "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe" sign /debug /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'
run: DEL cert.pfx

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

- 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: Create Windows Zip
working-directory: ./publish
run: |
Compress-Archive .\..\bin\Release\netcoreapp3.1\publish\WinX86\Coveo.Connectors.EasyFilePusher.exe Coveo.Connectors.EasyFilePusher_WinX86.zip
ls

- name: Release Windows executable
# Publish Github Release
- name: Create release
if: ${{ github.event_name == 'push' }}
uses: actions/upload-release-asset@v1
working-directory: ./publish
run: gh release create v${{ steps.nbgv.outputs.SemVer2 }} --generate-notes --target $GITHUB_SHA ./*.zip
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,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 or ApSouthEast2.

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

Expand Down
Loading
Loading