Skip to content

Commit

Permalink
Move to GHA (#4660)
Browse files Browse the repository at this point in the history
* update build 1st try

* fix Windows build
  • Loading branch information
leastprivilege authored Jul 15, 2020
1 parent 134c90f commit 577bc97
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 66 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
push:
branches:
- main
- features/**
tags:
- '*.*.*'
pull_request:

env:
DOTNET_NOLOGO: true

jobs:
build:
strategy:
fail-fast: false
matrix:
runs-on: [macOS-latest, ubuntu-latest, windows-latest]
name: ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@af513c7a016048ae468971c52ed77d9562c7c819
- run: dotnet --info

- if: contains(matrix.runs-on, 'macOS') || contains(matrix.runs-on, 'ubuntu')
run: ./build.sh
- if: matrix.runs-on == 'windows-latest' && github.ref != 'refs/heads/main' && !contains(github.ref, 'refs/tags/')
run: ./build.ps1
- if: (matrix.runs-on == 'windows-latest') && (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
env:
SignClientSecret: ${{ secrets.SIGNCLIENT }}
run: |
./build.ps1 sign
dotnet nuget push .\nuget\*.nupkg -s https://www.myget.org/F/identity/api/v2/package -k ${{ secrets.MYGET }}
59 changes: 0 additions & 59 deletions azure-pipelines.yml

This file was deleted.

14 changes: 14 additions & 0 deletions signClient.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"SignClient": {

"AzureAd": {
"AADInstance": "https://login.microsoftonline.com/",
"ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8",
"TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e"},

"Service": {
"Url": "https://codesign.dotnetfoundation.org/",
"ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001"
}
}
}
8 changes: 1 addition & 7 deletions src/build/Program.Partial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,8 @@ static void Main(string[] args)

private static void Sign(string path, string searchTerm)
{
var signClientConfig = Environment.GetEnvironmentVariable("SignClientConfig");
var signClientSecret = Environment.GetEnvironmentVariable("SignClientSecret");

if (string.IsNullOrWhiteSpace(signClientConfig))
{
throw new Exception($"SignClientConfig{envVarMissing}");
}

if (string.IsNullOrWhiteSpace(signClientSecret))
{
throw new Exception($"SignClientSecret{envVarMissing}");
Expand All @@ -103,7 +97,7 @@ private static void Sign(string path, string searchTerm)
foreach (var file in Directory.GetFiles(path, searchTerm, SearchOption.AllDirectories))
{
Console.WriteLine($" Signing {file}");
Run("dotnet", $"SignClient sign -c {signClientConfig} -i {file} -r [email protected] -s \"{signClientSecret}\" -n 'IdentityServer4'", noEcho: true);
Run("dotnet", $"SignClient sign -c ../../signClient.json -i {file} -r [email protected] -s \"{signClientSecret}\" -n 'IdentityServer4'", noEcho: true);
}
}
}
Expand Down

0 comments on commit 577bc97

Please sign in to comment.