Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated azure search #54

Merged
merged 32 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dc7e8ae
feat: updated workflows
aochmann May 7, 2021
3786777
chore: added vscode solution explorer templates
aochmann May 7, 2021
99f09fe
feat: sdk update + refactor
aochmann May 10, 2021
85cb71f
refactor: refactor search
aochmann May 10, 2021
44d9fcf
refactor: refactor index initializer
aochmann May 10, 2021
18eb85c
refactor: extended repository
aochmann May 10, 2021
3d31926
refactor: added filters
aochmann May 10, 2021
52cc001
refactor: added azure index
aochmann May 10, 2021
a66fcf2
refactor: added tests for core
aochmann May 10, 2021
ef0882c
feat: added more test for document operation tests
aochmann May 11, 2021
404d913
feat: update index operation tests
aochmann May 11, 2021
25bc1cb
feat: updating projects
aochmann May 12, 2021
abe83c3
fix: changed target framework
aochmann May 12, 2021
11d40ef
refactor: removed unused usings
aochmann May 12, 2021
413b81e
chore: changed operation class names
aochmann May 12, 2021
3877cc3
chore: removed new lines
aochmann May 12, 2021
74a1651
refactor: renamed index
aochmann May 12, 2021
51d1201
refactor: renamed initializer
aochmann May 12, 2021
13117f3
refactor: renamed operations
aochmann May 12, 2021
1d03a50
refactor: renamed repository
aochmann May 12, 2021
4c1ed8b
refactor: renamed mappers
aochmann May 12, 2021
e6856ea
refactor: renamed models
aochmann May 12, 2021
96e6e0a
refactor: renamed options
aochmann May 12, 2021
b8f80cc
refactor: renamed searcher
aochmann May 12, 2021
4a8f0c4
refactor: renamed generic parameter
aochmann May 12, 2021
636030b
refactor: renamed container builders
aochmann May 12, 2021
7587193
refactor: changed field name
aochmann May 12, 2021
acbb401
Merge pull request #55 from thecogworks/refactor/names
aochmann May 12, 2021
220d58e
refactor: added all cs files as compile for net framework projects
aochmann May 12, 2021
83009ee
chore: removed new lines
aochmann May 13, 2021
8f4775f
chore: removed unused using
aochmann May 13, 2021
04dfebb
chore: changed tabs to spaces
aochmann May 13, 2021
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
121 changes: 121 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Build

on:
workflow_run:
workflows: [ "Changelog generator" ]
types:
- completed
workflow_dispatch:

jobs:
build:
name: Build
runs-on: windows-latest
env:
# Dotnet Setup
DOTNET_VERSION: 3.1.401

# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true

# Solution Setup
CONFIG: 'Release'
PROJECT_NAME: 'Cogworks.AzureSearch'
VERSION: '1.0.0'
SOURCE_PATH: './Source'

# Nuget Setup
NUGET_VERSION: 'latest'
NUGET_OUTPUT: '.output/'

steps:
- name: Checkout reference commit
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v2

- name: Checkout master
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0

- name: Get version
if: ${{ github.event_name != 'pull_request' }}
shell: bash
run: |
tag_check=$(git describe --exact-match `git rev-parse HEAD` | head -1)
echo "VERSION=$tag_check" >> $GITHUB_ENV

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Configure NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: ${{ env.NUGET_VERSION }}

- name: NuGet Restore
shell: powershell
working-directory: ${{ github.workspace }}
run: |
$solutions = Get-ChildItem -Path ${{ env.SOURCE_PATH}} -Recurse -Include *.sln

foreach ($solutionFile in $solutions){
nuget restore "$solutionFile"
}

- name: Install Dependencies
shell: powershell
working-directory: ${{ github.workspace }}
run: |
$solutions = Get-ChildItem -Path ${{ env.SOURCE_PATH}} -Recurse -Include *.sln

foreach ($solutionFile in $solutions){
dotnet restore "$solutionFile"
}

- name: Build
shell: powershell
working-directory: ${{ github.workspace }}
run: |
$solutions = Get-ChildItem -Path ${{ env.SOURCE_PATH}} -Recurse -Include *.sln

foreach ($solutionFile in $solutions){
msbuild.exe "$solutionFile" `
/p:Configuration=${{ env.CONFIG }} `
/p:DeployOnBuild=false `
/p:SkipInvalidConfigurations=true `
/p:TransformWebConfigEnabled=False `
/p:AutoParameterizationWebConfigConnectionStrings=False `
/p:MarkWebConfigAssistFilesAsExclude=False
}

- name: Pack all nuspec files
if: ${{ github.event_name != 'pull_request' }}
shell: powershell
working-directory: ${{ github.workspace }}
run: |
$nuspecFiles = Get-ChildItem -Path ${{ env.SOURCE_PATH}} -Recurse -Include *.nuspec

foreach ($nuspecFile in $nuspecFiles){
nuget pack "$nuspecFile" `
-Version ${{ env.VERSION }} `
-Properties Configuration=${{ env.CONFIG }} `
-OutputDirectory ${{ env.NUGET_OUTPUT }}
}

- name: Upload build artifact
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v2
with:
name: build_${{ env.PROJECT_NAME }}.${{ env.VERSION }}
path: ${{ github.workspace }}/${{ env.NUGET_OUTPUT }}
85 changes: 85 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Changelog generator

on:
push:
tags:
- '*'

jobs:
changelog_generator:
name: Changelog Generator
runs-on: ubuntu-latest
env:
branch: master
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set local user
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Get tag branch
run: |
branch_check=$(git branch -r --contains $(git rev-parse $GITHUB_REF~0) | sed 's/remotes\/origin\///' | sed 's/origin\///' | sed 's/develop//' | sed 's/* //' | sed -r '/^\s*$/d' | head -1)

echo $branch_check

if [[ $branch_check =~ ^(release|master)$ ]]; then
echo "Not correct branch. Allowed branches release and master."
exit 1
fi

echo "branch=$branch_check" >> $GITHUB_ENV

- uses: actions/checkout@v2
name: Checkout tag branch
with:
fetch-depth: 0
ref: ${{ env.branch }}

- name: Get tag
run: |
echo "Describe: $(git describe)"
echo "Rev parse: $(git rev-parse $GITHUB_REF~0)"

tag_check=$(git describe --exact-match `git rev-parse $GITHUB_REF~0`)
echo "tag=$tag_check" >> $GITHUB_ENV

- name: Install dependencies
run: |
rm -rf node_modules
npm install

- name: Generate changelog and update npm version
run: |
npm run release

- name: Remove tag
run: |
git tag -d ${{ env.tag }}

- name: Updating tags
run: |
git pull "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" master
git tag -a ${{ env.tag }} -m "${{ env.tag }}"
git push "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" --tag -f

- name: Pushing latest changes to master
run: |
git pull "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" master
git push "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" ${{ env.branch }}:master

- name: Checkout master
run: |
git checkout master
git pull "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" master

- name: Generate GitHub release notes
run: |
npm run github-release
continue-on-error: true
54 changes: 54 additions & 0 deletions .github/workflows/gitflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Git Flow

on:
workflow_run:
workflows: [ "Changelog generator" ]
types:
- completed
jobs:
gitflow:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Git Flow
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0

- name: Set local user
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

- name: Get latest tag
run: |
tag_check=$(git describe --exact-match `git rev-parse HEAD` | head -1)
echo "tag=$tag_check" >> $GITHUB_ENV

- name: Clear release branch
run: |
branch_check=$(git branch -r | grep release/${{ env.tag }} | sed 's/remotes\/origin\///' | sed 's/origin\///' | sed 's/* //' | sed -r '/^\s*$/d' | head -1)
if [[ $branch_check ]]; then
git push "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" --delete $branch_check
fi

- name: Checkout develop and pull latest develop
run: |
git checkout develop
git pull "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" develop

- name: Pull master into develop
run: |
Conflicts=$(git pull "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" master -q --ff || echo "fatal: Not possible to fast-forward, aborting")
AbortingMsg='aborting'

if [[ "$Conflicts" == *"$AbortingMsg"* ]]; then
exit 1
fi

- name: Pushing develop to origin if pulling successfully
if: success()
run: |
git push "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" develop:develop
49 changes: 49 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: (NuGet) GitHub Packages Release

on:
workflow_run:
workflows: [ "Build" ]
types:
- completed
jobs:
github_packages_release:
name: GitHub Packages Release
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' }}
runs-on: ubuntu-latest
env:
# GitHub Packages Feed settings
GITHUB_USER: thecogworks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_FEED: https://nuget.pkg.github.com/thecogworks
GITHUB_PACKAGES_OUTPUT: ${{ github.workspace }}/github_packages

# Project Setup
PROJECT_NAME: 'Cogworks.AzureSearch'

steps:
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0

- name: Get version
shell: bash
run: |
tag_check=$(git describe --exact-match `git rev-parse HEAD` | head -1)
echo "VERSION=$tag_check" >> $GITHUB_ENV

- name: Download a single artifact
uses: aochmann/actions-download-artifact@1.0.2
with:
name: build_${{ env.PROJECT_NAME }}.${{ env.VERSION }}
path: ${{ env.GITHUB_PACKAGES_OUTPUT }}

- name: Push to GitHub Feed
shell: bash
working-directory: ${{ env.GITHUB_PACKAGES_OUTPUT }}
run: |
for nugetFile in ./*.nupkg
do
curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$nugetFile $GITHUB_FEED
done
54 changes: 54 additions & 0 deletions .github/workflows/release-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: (NuGet) NuGet Release

on:
workflow_run:
workflows: [ "Build" ]
types:
- completed
jobs:
nuget_release:
name: NuGet Release
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' }}
runs-on: ubuntu-latest
env:
# Nuget Setup
NUGET_VERSION: 'latest'
NUGET_OUTPUT: ${{ github.workspace }}/nuget/
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
NUGET_FEED: https://api.nuget.org/v3/index.json

# Project Setup
PROJECT_NAME: 'Cogworks.AzureSearch'

steps:
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0

- name: Get version
shell: bash
run: |
tag_check=$(git describe --exact-match `git rev-parse HEAD` | head -1)
echo "VERSION=$tag_check" >> $GITHUB_ENV

- name: Download a single artifact
uses: aochmann/actions-download-artifact@1.0.2
with:
name: build_${{ env.PROJECT_NAME }}.${{ env.VERSION }}
path: ${{ env.NUGET_OUTPUT }}

- name: Configure NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: ${{ env.NUGET_VERSION }}

- name: Push to NuGet Feed
shell: bash
working-directory: ${{ env.NUGET_OUTPUT }}
run: |
for nugetFile in ./*.nupkg
do
nuget push $nugetFile ${{ env.NUGET_TOKEN }} -Source ${{ env.NUGET_FEED }}
done
Loading