Skip to content

Bump tj-actions/changed-files from 35 to 41 in /.github/workflows (#314) #66

Bump tj-actions/changed-files from 35 to 41 in /.github/workflows (#314)

Bump tj-actions/changed-files from 35 to 41 in /.github/workflows (#314) #66

# Copyright 2020 Energinet DataHub A/S
#
# Licensed under the Apache License, Version 2.0 (the "License2");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Publish Databricks bundle
on:
# Build, test, pack and publish release packages
# Only executed if Databricks package content or build scripts has changed; not if solution file, documentation or tests has changed
push:
branches:
- main
paths:
- source/Databricks/source/SqlStatementExecution/**
- source/Databricks/source/Jobs/**
- .github/workflows/databricks-bundle-publish.yml
# Build, test, pack
# Executed if Databricks folder or build scripts has changed; including if documentation or tests has changed
workflow_call: {}
# Build, test, pack and publish prerelease packages
# Executed if manually triggered
workflow_dispatch: {}
env:
# Conditions
PUSH_PACKAGES: ${{ github.event_name != 'pull_request' }}
# Necessary to manage Azure resources from automated tests
AZURE_KEYVAULT_URL: ${{ vars.integration_test_azure_keyvault_url }}
# Set value used by 'AzuriteManager'
# Use 'AzuriteBlobFolderPath' for TestCommon version 4.2.0 and lower
AzuriteBlobFolderPath: ${{ github.workspace }}\node_modules\.bin\
# Use 'AzuriteFolderPath' for TestCommon version 4.3.0 and higher
AzuriteFolderPath: ${{ github.workspace }}\node_modules\.bin\
# Overrides settings in 'functionhost.settings.json'
FunctionAppHostPath: ${{ github.workspace }}\node_modules\azure-functions-core-tools\bin\func.dll
jobs:
build_and_publish:
runs-on: windows-2022
name: Publish bundle to NuGet.org
environment: AzureAuth
# We need to have permissions here to be able to support manually triggering this workflow for releasing a pre-release
permissions:
id-token: write # Needed by 'dotnet-solution-build-and-test' to login to Azure
contents: read # Needed by https://github.com/EnricoMi/publish-unit-test-result-action
issues: read # Needed by https://github.com/EnricoMi/publish-unit-test-result-action
checks: write # Needed by https://github.com/EnricoMi/publish-unit-test-result-action
pull-requests: write # Needed by https://github.com/EnricoMi/publish-unit-test-result-action
steps:
- name: Checkout repository
uses: Energinet-DataHub/.github/.github/actions/nuget-checkout-repository@v13
- name: Setup dotnet and tools
uses: Energinet-DataHub/.github/.github/actions/dotnet-setup-and-tools@v13
with:
use_azure_functions_tools: "true"
- name: Build and test solution
uses: Energinet-DataHub/.github/.github/actions/dotnet-solution-build-and-test@v13
with:
solution_file_path: ./source/Databricks/Databricks.sln
azure_tenant_id: ${{ vars.integration_test_azure_tenant_id }}
azure_subscription_id: ${{ vars.integration_test_azure_subscription_id }}
azure_spn_id: ${{ vars.integration_test_azure_spn_id_oidc }}
publish_test_report: "true"
- name: Pack SQL Statement Execution project
uses: Energinet-DataHub/.github/.github/actions/nuget-project-pack@v13
with:
project_path: ./source/Databricks/source/SqlStatementExecution/SqlStatementExecution.csproj
- name: Pack Jobs project
uses: Energinet-DataHub/.github/.github/actions/nuget-project-pack@v13
with:
project_path: ./source/Databricks/source/Jobs/Jobs.csproj
- name: Package content or build has changed
id: changed-content
uses: tj-actions/changed-files@v41
with:
files: |
source/Databricks/source/SqlStatementExecution/**/*.*
source/Databricks/source/Jobs/**/*.*
.github/workflows/databricks-bundle-publish.yml
- name: Assert versions of NuGet packages and push them to NuGet.org
uses: Energinet-DataHub/.github/.github/actions/nuget-packages-assert-and-push@v13
with:
push_packages: ${{ env.PUSH_PACKAGES }}
content_changed: ${{ steps.changed-content.outputs.any_changed }}
nuget_token: ${{ secrets.nuget_token }}
nupkg_recurse_path: source/Databricks/source
#
# Branch policy status check
#
allow_merge:
runs-on: ubuntu-latest
needs: [build_and_publish]
if: |
always()
steps:
- name: Verify if merge is allowed
run: |
echo "${{ toJSON(needs) }}"
if [[ ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} = true ]]; then
echo "Failed"
exit 1
fi