Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/ExtensionStoreAPI.Core/Extensions/QueryableExtensions.cs
  • Loading branch information
manuelmayer-dev committed Oct 5, 2023
2 parents 2e02ee3 + 97c5f31 commit d66ab94
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 34 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/deploy-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ jobs:

deploy:
name: Build and deploy Docker image
environment: staging
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: Updating the image on the server
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.DOCKER_HOST }}
username: ${{ secrets.GITHUBWORKFLOWS_USER }}
password: ${{ secrets.GITHUBWORKFLOWS_USER_PASSWORD }}
port: ${{ secrets.DOCKER_HOST_PORT }}
script: |
cd "scripts/extension-store-api/"
./update_develop.sh ${{ github.sha }}
- name: Updating the image on the server
uses: Macro-Deck-App/Actions/deploy@main
with:
host: ${{ secrets.TEST_DEPLOY_HOST }}
user: ${{ secrets.TEST_DEPLOY_USER }}
key: ${{ secrets.TEST_DEPLOY_KEY }}
known-hosts: ${{ secrets.TEST_DEPLOY_KNOWN_HOSTS }}
sha: ${{ github.sha }}
service: extension-store-api

- uses: fjogeleit/http-request-action@v1
with:
url: 'https://bot.api.macro-deck.app/webhook/extensionstoreapi-workflow'
method: 'POST'
bearerToken: ${{ secrets.WEBHOOK_KEY }}
customHeaders: '{"Content-Type": "application/json" }'
data: '{"toEveryone":false,"embed":{"color":{"r":0,"g":1,"b":0},"description":"https://test.extensionstore.api.macro-deck.app is now on dev_${{ github.sha }}.","fields":[{"name":"Branch","value":"Develop","inline":false},{"name":"SHA","value":"${{ github.sha }}","inline":false}]}}'
- uses: fjogeleit/http-request-action@v1
with:
url: 'https://bot.api.macro-deck.app/webhook/extensionstoreapi-workflow'
method: 'POST'
bearerToken: ${{ secrets.WEBHOOK_KEY }}
customHeaders: '{"Content-Type": "application/json" }'
data: '{"toEveryone":false,"embed":{"color":{"r":0,"g":1,"b":0},"description":"https://test.extensionstore.api.macro-deck.app is now on dev_${{ github.sha }}.","fields":[{"name":"Branch","value":"Develop","inline":false},{"name":"SHA","value":"${{ github.sha }}","inline":false}]}}'
16 changes: 8 additions & 8 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:

deploy:
name: Build and deploy Docker image
environment: production
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: Updating the image on the server
uses: appleboy/ssh-action@v0.1.10
uses: Macro-Deck-App/Actions/deploy@main
with:
host: ${{ secrets.DOCKER_HOST }}
username: ${{ secrets.GITHUBWORKFLOWS_USER }}
password: ${{ secrets.GITHUBWORKFLOWS_USER_PASSWORD }}
port: ${{ secrets.DOCKER_HOST_PORT }}
script: |
cd "scripts/extension-store-api/"
./update_production.sh ${{ github.sha }}
host: ${{ secrets.LIVE_DEPLOY_HOST }}
user: ${{ secrets.LIVE_DEPLOY_USER }}
key: ${{ secrets.LIVE_DEPLOY_KEY }}
known-hosts: ${{ secrets.LIVE_DEPLOY_KNOWN_HOSTS }}
sha: ${{ github.sha }}
service: extension-store-api

- uses: fjogeleit/http-request-action@v1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,11 @@ public async ValueTask<PagedList<ExtensionFileEntity>> GetFilesAsync(string pack
string? version = null,
int? targetApiVersion = null)
{
if (version is null)
{
return await _context.GetNoTrackingSet<ExtensionFileEntity>()
.FilterTargetApiVersion(targetApiVersion)
.OrderByDescending(x => x.Version)
.FirstOrDefaultAsync(x => x.ExtensionEntity != null && x.ExtensionEntity.PackageId == packageId);
}

return await _context.Set<ExtensionFileEntity>().Include(x => x.ExtensionEntity)
.FilterTargetApiVersion(targetApiVersion)
.FilterFileVersion(version)
.Where(x => x.ExtensionEntity != null && x.ExtensionEntity.PackageId == packageId)
.OrderByDescending(x => x.Version)
.Take(1)
.FirstOrDefaultAsync();
}

Expand Down

0 comments on commit d66ab94

Please sign in to comment.