Skip to content

Commit

Permalink
Fix pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed May 29, 2024
1 parent 84b0c3e commit 1e966e8
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 74 deletions.
126 changes: 67 additions & 59 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Build

on: [push, pull_request, workflow_dispatch]
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
workflow_dispatch:

permissions:
id-token: write
Expand All @@ -14,68 +21,69 @@ jobs:
os:
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration Release
- name: Build
run: dotnet build --no-restore --configuration Release

- name: Pack
run: dotnet pack --output artifacts --no-restore --no-build --configuration Release
- name: Pack
run: dotnet pack --output artifacts --no-restore --no-build --configuration Release

- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Azure login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Download Sign CLI
run: |
mkdir bin
az storage blob download --blob-url ${{ secrets.SIGN_CLI_ZIP }} --auth-mode login --file bin/Sign.Cli.zip
- name: Unzip Sign CLI
shell: pwsh
run: Expand-Archive -Force bin/Sign.Cli.zip bin/Sign.Cli

- name: Run Sign CLI
shell: pwsh
run: |
& "bin\Sign.Cli\sign.exe" code azcodesign artifacts\* `
-acsu "${{ secrets.TRUSTED_SIGNING_ENDPOINT }}" `
-acsa "${{ secrets.TRUSTED_SIGNING_ACCOUNT }}" `
-acscp "${{ secrets.TRUSTED_SIGNING_PROFILE }}" `
-v "Debug" `
-d "Knapcode.PackageLifeCycle" `
-u "https://www.nuget.org/packages/Knapcode.PackageLifeCycle" `
--azcodesign-managed-identity `
--file-list sign-file-list.txt
- name: Extract .cer file
shell: pwsh
run: |
dotnet tool install --global Knapcode.CertificateExtractor
$nupkg = gci artifacts\*.nupkg
nuget-cert-extractor --file $nupkg --output artifacts --code-signing --author --leaf
- name: Download Sign CLI
run: |
mkdir bin
az storage blob download --blob-url ${{ secrets.SIGN_CLI_ZIP }} --auth-mode login --file bin/Sign.Cli.zip
- uses: actions/upload-artifact@v3
name: Upload artifacts
with:
name: ${{ matrix.os }}-artifacts
path: artifacts/
- name: Upload Test Results
if: failure()
uses: actions/upload-artifact@v3
with:
name: verify-test-results
path: |
**/*.received.*
- name: Unzip Sign CLI
shell: pwsh
run: Expand-Archive -Force bin/Sign.Cli.zip bin/Sign.Cli

- name: Run Sign CLI
shell: pwsh
run: |
& "bin\Sign.Cli\sign.exe" code azcodesign artifacts\* `
-acsu "${{ secrets.TRUSTED_SIGNING_ENDPOINT }}" `
-acsa "${{ secrets.TRUSTED_SIGNING_ACCOUNT }}" `
-acscp "${{ secrets.TRUSTED_SIGNING_PROFILE }}" `
-v "Debug" `
-d "Knapcode.PackageLifeCycle" `
-u "https://www.nuget.org/packages/Knapcode.PackageLifeCycle" `
--azcodesign-managed-identity `
--file-list sign-file-list.txt
- name: Extract .cer file
shell: pwsh
run: |
dotnet tool install --global Knapcode.CertificateExtractor
$nupkg = gci artifacts\*.nupkg
nuget-cert-extractor --file $nupkg --output artifacts --code-signing --author --leaf
- uses: actions/upload-artifact@v3
name: Upload artifacts
with:
name: ${{ matrix.os }}-artifacts
path: artifacts/

- name: Upload Test Results
if: failure()
uses: actions/upload-artifact@v3
with:
name: verify-test-results
path: |
**/*.received.*
32 changes: 17 additions & 15 deletions .github/workflows/on-push-do-docs.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
name: on-push-do-docs

on:
push:

jobs:
docs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Run MarkdownSnippets
run: |
dotnet tool install --global MarkdownSnippets.Tool
mdsnippets ${GITHUB_WORKSPACE}
shell: bash
- name: Push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Docs changes" -a || echo "nothing to commit"
remote="https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
branch="${GITHUB_REF:11}"
git push "${remote}" ${branch} || echo "nothing to push"
shell: bash
- uses: actions/checkout@v2
- name: Run MarkdownSnippets
run: |
dotnet tool install --global MarkdownSnippets.Tool
mdsnippets ${GITHUB_WORKSPACE}
shell: bash
- name: Push changes
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date --iso-8601=seconds)
git commit -m "Latest data: ${timestamp}" || exit 0
git push
shell: bash

0 comments on commit 1e966e8

Please sign in to comment.