Skip to content

Commit

Permalink
refac: Fix PM Client bundle publish workflow (#85)
Browse files Browse the repository at this point in the history
* Only update Orchestrations.Abstractions

* List changed files

* Bash

* Ignore build script changes

* workflow_dispatch

* ref_name

* fetch-depth: 0

* v45

* base_sha: 'main'

* Remove quotes

* base_sha: ${{ env.BASE_SHA }}

* Commented

* Detect build changes again

* Bump version and update release notes because we changed workflow
  • Loading branch information
dstenroejl authored Jan 8, 2025
1 parent 74ad749 commit e92a37d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 15 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/processmanager-client-bundle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ env:
# Conditions
# TRIGGERED_BY_PR_COMMIT is true if this run is automatically triggered by a commit in a Pull Request (feature branch)
TRIGGERED_BY_PR_COMMIT: ${{ github.event_name == 'pull_request' }}
# BASE_SHA must be set to 'main' if this run is triggered manually; otherwise file changes will not be detected correctly
BASE_SHA: ${{ (github.event_name == 'workflow_dispatch') && 'main' || '' }}
# Necessary to manage Azure resources from automated tests
AZURE_KEYVAULT_URL: ${{ vars.integration_test_azure_keyvault_url }}
# Set value used by 'AzuriteManager'
Expand Down Expand Up @@ -114,13 +116,23 @@ jobs:

- name: Package content or build has changed for PM.Client or PM.Abstractions
id: changed-content-client
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v45
with:
base_sha: ${{ env.BASE_SHA }}
files: |
source/ProcessManager.Client/**/*.*
source/ProcessManager.Abstractions/**/*.*
.github/workflows/processmanager-client-bundle-publish.yml
- name: List all changed files for PM.Client or PM.Abstractions
env:
ALL_CHANGED_FILES: ${{ steps.changed-content-client.outputs.all_changed_files }}
shell: bash
run: |
for file in "$ALL_CHANGED_FILES"; do
echo "$file was changed"
done
- name: Assert version of ProcessManager.Client NuGet package and push it to NuGet.org
uses: Energinet-DataHub/.github/.github/actions/nuget-packages-assert-and-push@v14
with:
Expand All @@ -143,27 +155,27 @@ jobs:
# version of ProcessManager.Orchestrations.Abstractions is bumped.
- name: Package content, dependencies or build has changed for PM.Abstractions or PM.Orchestrations.Abstractions
id: changed-content-orchestrations
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v45
with:
base_sha: ${{ env.BASE_SHA }}
files: |
source/ProcessManager.Orchestrations.Abstractions/**/*.*
source/ProcessManager.Abstractions/**/*.*
.github/workflows/processmanager-client-bundle-publish.yml
- name: List all changed files for PM.Abstractions or PM.Orchestrations.Abstractions
env:
ALL_CHANGED_FILES: ${{ steps.changed-content-orchestrations.outputs.all_changed_files }}
shell: bash
run: |
for file in "$ALL_CHANGED_FILES"; do
echo "$file was changed"
done
- name: Assert version of ProcessManager.Orchestrations.Abstractions NuGet package and push it to NuGet.org
uses: Energinet-DataHub/.github/.github/actions/nuget-packages-assert-and-push@v14
with:
push_packages: ${{ env.TRIGGERED_BY_PR_COMMIT == 'false' && steps.changed-content-orchestrations.outputs.any_changed == 'true' }}
content_changed: ${{ steps.changed-content-orchestrations.outputs.any_changed }}
nuget_token: ${{ secrets.nuget_token }}
nupkg_recurse_path: source/ProcessManager.Orchestrations.Abstractions

- name: Print variables
run: |
echo "TRIGGERED_BY_PR_COMMIT: ${{ env.TRIGGERED_BY_PR_COMMIT }}"
echo "ProcessManager.Client content changed: ${{ steps.changed-content-client.outputs.any_changed }}"
echo "ProcessManager.Client push packages: ${{ env.TRIGGERED_BY_PR_COMMIT == 'false' && steps.changed-content-client.outputs.any_changed == 'true' }}"
echo "Orchestrations.Abstractions content changed: ${{ steps.changed-content-orchestrations.outputs.any_changed }}"
echo "Orchestrations.Abstractions push packages: ${{ env.TRIGGERED_BY_PR_COMMIT == 'false' && steps.changed-content-orchestrations.outputs.any_changed == 'true' }}"
4 changes: 4 additions & 0 deletions docs/ProcessManager.Client/ReleaseNotes/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ProcessManager.Client Release Notes

## Version 0.15.3

- No functional changes.

## Version 0.15.2

- Internal refactoring.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ProcessManager.Orchestrations.Abstractions Release Notes

## Version 0.4.3

- No functional changes.

## Version 0.4.2

- No functional changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<PackageId>Energinet.DataHub.ProcessManager.Abstractions</PackageId>
<PackageVersion>0.15.2$(VersionSuffix)</PackageVersion>
<PackageVersion>0.15.3$(VersionSuffix)</PackageVersion>
<Title>DH3 Process Manager Abstractions library</Title>
<Company>Energinet-DataHub</Company>
<Authors>Energinet-DataHub</Authors>
Expand Down
2 changes: 1 addition & 1 deletion source/ProcessManager.Client/ProcessManager.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<PropertyGroup>
<PackageId>Energinet.DataHub.ProcessManager.Client</PackageId>
<PackageVersion>0.15.2$(VersionSuffix)</PackageVersion>
<PackageVersion>0.15.3$(VersionSuffix)</PackageVersion>
<Title>DH3 Process Manager Client library</Title>
<Company>Energinet-DataHub</Company>
<Authors>Energinet-DataHub</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<PackageId>Energinet.DataHub.ProcessManager.Orchestrations.Abstractions</PackageId>
<PackageVersion>0.4.2$(VersionSuffix)</PackageVersion>
<PackageVersion>0.4.3$(VersionSuffix)</PackageVersion>
<Title>DH3 Process Manager Orchestrations Abstractions library</Title>
<Company>Energinet-DataHub</Company>
<Authors>Energinet-DataHub</Authors>
Expand Down

0 comments on commit e92a37d

Please sign in to comment.