Skip to content

Commit

Permalink
Update build for breaking change in reusable workflow (#187)
Browse files Browse the repository at this point in the history
* Update secrets authoring to work with latest changes to shared workflow
* Enable tests
* Fix broken test
  • Loading branch information
JamesDawson authored Sep 11, 2023
1 parent bd4e596 commit 4948ad2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,17 @@ jobs:
name: Prepare Configuration
runs-on: ubuntu-latest
outputs:
RESOLVED_ENV_VARS: ${{ steps.prepareEnvVarsAndSecrets.outputs.environmentVariablesJsonBase64 }}
RESOLVED_SECRETS: ${{ steps.prepareEnvVarsAndSecrets.outputs.secretsJsonBase64 }}
RESOLVED_ENV_VARS: ${{ steps.prepareEnvVarsAndSecrets.outputs.environmentVariablesYamlBase64 }}
RESOLVED_SECRETS: ${{ steps.prepareEnvVarsAndSecrets.outputs.secretsYamlBase64 }}
steps:
# Declare any environment variables and/or secrets that need to be available inside the build process
- uses: endjin/Endjin.RecommendedPractices.GitHubActions/actions/prepare-env-vars-and-secrets@main
id: prepareEnvVarsAndSecrets
with:
environmentVariablesJson: |
{
"BUILDVAR_NuGetPublishSource": "${{ startsWith(github.ref, 'refs/tags/') && 'https://api.nuget.org/v3/index.json' || 'https://nuget.pkg.github.com/endjin/index.json' }}"
}
secretsJson: |
{
"NUGET_API_KEY": "${{ startsWith(github.ref, 'refs/tags/') && secrets.ENDJIN_NUGET_APIKEY || secrets.ENDJIN_GITHUB_PUBLISHER_PAT }}"
}
environmentVariablesYaml: |
BUILDVAR_NuGetPublishSource: "${{ startsWith(github.ref, 'refs/tags/') && 'https://api.nuget.org/v3/index.json' || 'https://nuget.pkg.github.com/endjin/index.json' }}"
secretsYaml: |
NUGET_API_KEY: "${{ startsWith(github.ref, 'refs/tags/') && secrets.ENDJIN_NUGET_APIKEY || secrets.ENDJIN_GITHUB_PUBLISHER_PAT }}"
build:
needs: prepareConfig
Expand All @@ -63,4 +59,6 @@ jobs:
forcePublish: ${{ github.event.inputs.forcePublish == 'true' }}
skipCleanup: ${{ github.event.inputs.skipCleanup == 'true' }}
publishPhaseEnv: ${{ needs.prepareConfig.outputs.RESOLVED_ENV_VARS }}
secrets:
compilePhaseAzureCredentials: ${{ secrets.ENDJIN_PROD_ACR_READER_CREDENTIALS }}
publishPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
2 changes: 1 addition & 1 deletion Solutions/Endjin.Adr.Cli.Specs/Steps/InitSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void GivenIAskTheAdrCliToInitialiseANewRepoInTheDirectory(string director
[When("I execute the adr cli")]
public async Task WhenIExecuteTheAdrCli()
{
string[] args = new string[] { "init", this.scenarioContext.Get<string>("Directory") };
string[] args = new string[] { "environment", "init", this.scenarioContext.Get<string>("Directory") };

int result = await Program.Main(args).ConfigureAwait(false);

Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ $SkipInit = $false
$SkipVersion = $false
$SkipBuild = $false
$CleanBuild = $Clean
$SkipTest = $true
$SkipTest = $false
$SkipTestReport = $false
$SkipAnalysis = $false
$SkipPackage = $false
Expand Down

0 comments on commit 4948ad2

Please sign in to comment.