generated from credfeto/cs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dependencies] - Update .github/actions/build/action.yml to match the…
… template repo
- Loading branch information
Showing
1 changed file
with
54 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,7 +169,9 @@ runs: | |
[[ (${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true'}}) || steps.check_files.outputs.NPM_EXIST == 'true' ]] && echo 'BUILD_ENV=true' >> "$GITHUB_OUTPUT" || echo 'BUILD_ENV=false' >> "$GITHUB_OUTPUT" | ||
[[ (${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true'}}) || steps.check_files.outputs.NPM_EXIST == 'true' ]] && echo 'BUILD_ENV=true' >> "$GITHUB_OUTPUT" || echo 'BUILD_ENV=false' >> "$GITHUB_OUTPUT" | ||
- if: ${{steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.NUGET_PACK == 'true'}} | ||
- if: |- | ||
steps.build_tools.outputs.BUILD_ENV == 'true' && | ||
inputs.NUGET_PACK == 'true' | ||
name: "Install Multi-Push Tool" | ||
shell: bash | ||
run: dotnet tool install --local Credfeto.Package.Push | ||
|
@@ -184,14 +186,14 @@ runs: | |
DOTNET_TieredPGO: "1" | ||
- name: "Get Unique Build Number" | ||
if: ${{steps.build_tools.outputs.BUILD_ENV == 'true'}} | ||
if: steps.build_tools.outputs.BUILD_ENV == 'true' | ||
uses: onyxmueller/build-tag-number@v1 | ||
id: build-number | ||
with: | ||
token: ${{inputs.GITHUB_TOKEN}} | ||
prefix: github | ||
|
||
- if: ${{steps.build_tools.outputs.BUILD_ENV == 'true'}} | ||
- if: steps.build_tools.outputs.BUILD_ENV == 'true' | ||
name: "Set Define Build Version" | ||
shell: bash | ||
run: dotnet buildversion --BuildNumber "${{steps.build-number.outputs.build_number}}" | ||
|
@@ -211,25 +213,25 @@ runs: | |
{ echo "DEPLOY=false"; } >> "$GITHUB_ENV" | ||
- name: "Deploy check - Is main or master" | ||
if: ${{endsWith(env.BUILD_VERSION, '-main') || endsWith(env.BUILD_VERSION, '-master')}} | ||
if: endsWith(env.BUILD_VERSION, '-main') || endsWith(env.BUILD_VERSION, '-master') | ||
shell: bash | ||
run: | | ||
{ echo "DEPLOY=true"; echo "RELEASE=false"; } >> "$GITHUB_ENV" | ||
- name: Deploy check - Is release branch | ||
if: ${{!contains(env.BUILD_VERSION, '-')}} | ||
if: contains(env.BUILD_VERSION, '-') == false | ||
shell: bash | ||
run: | | ||
{ echo "DEPLOY=true"; echo "RELEASE=true"; } >> "$GITHUB_ENV" | ||
- name: "Deploy check - Is Dependabot" | ||
if: ${{(github.actor == 'dependabot[bot]')}} | ||
if: (github.actor == 'dependabot[bot]') | ||
shell: bash | ||
run: | | ||
{ echo "DEPLOY=false"; } >> "$GITHUB_ENV" | ||
- name: "Install Package Builder" | ||
if: ${{steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' }} | ||
if: steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' | ||
shell: bash | ||
run: dotnet tool install --local FunFair.Content.Packager.Cmd --version ${{inputs.NPM_PRODUCTION_PACKAGER_VERSION}} | ||
env: | ||
|
@@ -243,7 +245,7 @@ runs: | |
DOTNET_TieredPGO: "1" | ||
|
||
- name: "Install Package Store Signer" | ||
if: ${{steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' }} | ||
if: steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' | ||
shell: bash | ||
run: dotnet tool install --local FunFair.Content.PackageSigner.Cmd --version ${{inputs.NPM_PRODUCTION_PACKAGER_VERSION}} | ||
env: | ||
|
@@ -257,13 +259,13 @@ runs: | |
DOTNET_TieredPGO: "1" | ||
|
||
- name: "Install Octopus Deploy CLI" | ||
if: ${{steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} | ||
if: steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != '' | ||
uses: OctopusDeploy/[email protected] | ||
with: | ||
version: latest | ||
|
||
- name: "Create Release Notes" | ||
if: ${{steps.build_tools.outputs.BUILD_ENV == 'true'}} | ||
if: steps.build_tools.outputs.BUILD_ENV == 'true' | ||
shell: bash | ||
run: dotnet changelog --changelog CHANGELOG.md --extract RELEASE_NOTES.md --version "${{env.BUILD_VERSION}}" | ||
env: | ||
|
@@ -277,7 +279,7 @@ runs: | |
DOTNET_TieredPGO: "1" | ||
|
||
- name: "Read Release Notes" | ||
if: ${{steps.build_tools.outputs.BUILD_ENV == 'true'}} | ||
if: steps.build_tools.outputs.BUILD_ENV == 'true' | ||
id: release-notes | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
|
@@ -287,7 +289,7 @@ runs: | |
# DOTNET BUILD | ||
############################################################################################################ | ||
- name: "Dotnet: Build" | ||
if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true'}} | ||
if: steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' | ||
uses: ./.github/actions/dotnet | ||
with: | ||
BUILD_VERSION: ${{env.BUILD_VERSION}} | ||
|
@@ -307,7 +309,7 @@ runs: | |
# NPM BUILD | ||
############################################################################################################ | ||
- name: "Npm: Build" | ||
if: ${{steps.check_files.outputs.NPM_EXIST == 'true'}} | ||
if: steps.check_files.outputs.NPM_EXIST == 'true' | ||
uses: ./.github/actions/npm | ||
with: | ||
BUILD_VERSION: ${{env.BUILD_VERSION}} | ||
|
@@ -325,7 +327,11 @@ runs: | |
############################################################################################################ | ||
|
||
- name: "Dotnet: Push package to Octopus (EXE and DB)" | ||
if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' && steps.check_files.outputs.SQL_EXIST == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} | ||
if: |- | ||
steps.check_files.outputs.CSPROJ_EXIST == 'true' && | ||
steps.check_files.outputs.SLN_EXIST == 'true' && | ||
steps.check_files.outputs.SQL_EXIST == 'true' && | ||
inputs.OCTOPUS_DEPLOY_PACKAGE != '' | ||
shell: bash | ||
run: octopus package upload --no-prompt --overwrite-mode=ignore --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-win-x64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-x64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-arm64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-database.${{env.BUILD_VERSION}}.zip" | ||
env: | ||
|
@@ -334,7 +340,11 @@ runs: | |
OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" | ||
|
||
- name: "Dotnet: Push package to Octopus (EXE ONLY)" | ||
if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' && steps.check_files.outputs.SQL_EXIST != 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} | ||
if: |- | ||
steps.check_files.outputs.CSPROJ_EXIST == 'true' && | ||
steps.check_files.outputs.SLN_EXIST == 'true' && | ||
steps.check_files.outputs.SQL_EXIST != 'true' && | ||
inputs.OCTOPUS_DEPLOY_PACKAGE != '' | ||
shell: bash | ||
run: octopus package upload --no-prompt --overwrite-mode=ignore --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-win-x64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-x64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-arm64.${{env.BUILD_VERSION}}.zip" | ||
env: | ||
|
@@ -343,7 +353,10 @@ runs: | |
OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" | ||
|
||
- name: "Dotnet: Push package to Octopus (NPM NUPKG ONLY)" | ||
if: ${{steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} | ||
if: |- | ||
steps.check_files.outputs.NPM_EXIST == 'true' && | ||
steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' && | ||
inputs.OCTOPUS_DEPLOY_PACKAGE != '' | ||
shell: bash | ||
run: octopus package upload --no-prompt --overwrite-mode=ignore --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-${{env.BUILD_VERSION}}.nupkg" | ||
env: | ||
|
@@ -352,7 +365,13 @@ runs: | |
OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" | ||
|
||
- name: "Dotnet: Create Octopus Release (EXE and DB)" | ||
if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' && steps.check_files.outputs.SQL_EXIST == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != '' && inputs.OCTOPUS_CHANNEL != '' && env.DEPLOY == 'true'}} | ||
if: |- | ||
steps.check_files.outputs.CSPROJ_EXIST == 'true' && | ||
steps.check_files.outputs.SLN_EXIST == 'true' && | ||
steps.check_files.outputs.SQL_EXIST == 'true' && | ||
inputs.OCTOPUS_DEPLOY_PACKAGE != '' && | ||
inputs.OCTOPUS_CHANNEL != '' && | ||
env.DEPLOY == 'true' | ||
shell: bash | ||
run: octopus release create --no-prompt --project="${{inputs.OCTOPUS_PROJECT}}" --version="${{env.BUILD_VERSION}}" --channel="${{inputs.OCTOPUS_CHANNEL}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-win-x64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-x64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-arm64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-database:${{env.BUILD_VERSION}}" --release-notes-file="RELEASE_NOTES.md" | ||
env: | ||
|
@@ -361,7 +380,13 @@ runs: | |
OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" | ||
|
||
- name: "Dotnet: Create Octopus Release (EXE ONLY)" | ||
if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' && steps.check_files.outputs.SQL_EXIST != 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != '' && inputs.OCTOPUS_CHANNEL != '' && env.DEPLOY == 'true'}} | ||
if: |- | ||
steps.check_files.outputs.CSPROJ_EXIST == 'true' && | ||
steps.check_files.outputs.SLN_EXIST == 'true' && | ||
steps.check_files.outputs.SQL_EXIST != 'true' && | ||
inputs.OCTOPUS_DEPLOY_PACKAGE != '' && | ||
inputs.OCTOPUS_CHANNEL != '' && | ||
env.DEPLOY == 'true' | ||
shell: bash | ||
run: octopus release create --no-prompt --project="${{inputs.OCTOPUS_PROJECT}}" --version="${{env.BUILD_VERSION}}" --channel="${{inputs.OCTOPUS_CHANNEL}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-win-x64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-x64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-arm64:${{env.BUILD_VERSION}}" --release-notes-file="RELEASE_NOTES.md" | ||
env: | ||
|
@@ -370,7 +395,10 @@ runs: | |
OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" | ||
|
||
- name: "Dotnet: Create Octopus Release (NPM ONLY)" | ||
if: ${{steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} | ||
if: |- | ||
steps.check_files.outputs.NPM_EXIST == 'true' && | ||
steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' && | ||
inputs.OCTOPUS_DEPLOY_PACKAGE != '' | ||
shell: bash | ||
run: octopus release create --no-prompt --project="${{inputs.OCTOPUS_PROJECT}}" --version="${{env.BUILD_VERSION}}" --channel="${{inputs.OCTOPUS_CHANNEL}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}:${{env.BUILD_VERSION}}" --release-notes-file="RELEASE_NOTES.md" | ||
env: | ||
|
@@ -379,7 +407,12 @@ runs: | |
OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" | ||
|
||
- name: "Deploy Octopus Release" | ||
if: ${{((steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true') || (steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true')) && inputs.OCTOPUS_DEPLOY_PACKAGE != '' && inputs.OCTOPUS_CHANNEL != '' && env.DEPLOY == 'true'}} | ||
if: |- | ||
((steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true') || | ||
(steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true')) && | ||
inputs.OCTOPUS_DEPLOY_PACKAGE != '' && | ||
inputs.OCTOPUS_CHANNEL != '' && | ||
env.DEPLOY == 'true' | ||
shell: bash | ||
run: octopus release deploy --no-prompt --project="${{inputs.OCTOPUS_PROJECT}}" --version="${{env.BUILD_VERSION}}" --environment="${{inputs.OCTOPUS_DEPLOY_TO}}" | ||
env: | ||
|
@@ -391,7 +424,7 @@ runs: | |
# Create GitHub Release | ||
############################################################################################################ | ||
- name: "Create Release" | ||
if: ${{steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.CREATE_RELEASE == 'true'}} | ||
if: steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.CREATE_RELEASE == 'true' | ||
id: create_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
|