Skip to content

Commit 5a3d4f9

Browse files
committed
Add an "IgnoreThis" project.
Facilitates changes to CI/Release that can be tested end-to-end.
1 parent 0410b07 commit 5a3d4f9

20 files changed

+810
-0
lines changed

.github/workflows/ignore-this-ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: access-token-management\ci
2+
3+
permissions:
4+
contents: read
5+
checks: write
6+
packages: write
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches:
12+
- main
13+
tags:
14+
- access-token-management-v*
15+
paths:
16+
- .github/workflows/access-token-management-ci.yml
17+
- access-token-management/*
18+
pull_request:
19+
paths:
20+
- .github/workflows/access-token-management-ci.yml
21+
- access-token-management/*
22+
23+
env:
24+
DOTNET_NOLOGO: true
25+
26+
defaults:
27+
run:
28+
working-directory: access-token-management
29+
shell: pwsh
30+
31+
jobs:
32+
build:
33+
name: Build
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
41+
- uses: actions/setup-dotnet@v4
42+
with:
43+
dotnet-version: |
44+
8.0.x
45+
46+
- name: Build
47+
run: ./build.ps1
48+
49+
- name: Test report
50+
id: test-report
51+
uses: dorny/test-reporter@v1
52+
if: success() || failure() # run this step even if previous step failed
53+
with:
54+
name: Test results
55+
path: access-token-management/test/AccessTokenManagement.Tests/TestResults/Test.trx
56+
reporter: dotnet-trx
57+
fail-on-error: true
58+
fail-on-empty: true
59+
60+
- name: Install Sectigo CodeSiging CA certificates
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install -y ca-certificates
64+
sudo cp build/SectigoPublicCodeSigningRootCrossAAA.crt /usr/local/share/ca-certificates/
65+
sudo update-ca-certificates
66+
67+
- name: Sign
68+
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
69+
env:
70+
SignClientSecret: ${{ secrets.SignClientSecret }}
71+
run: ./build.ps1 sign
72+
73+
- name: Push packages to MyGet
74+
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
75+
run: dotnet nuget push artifacts\*.nupkg -s https://www.myget.org/F/duende_identityserver/api/v2/package -k ${{ secrets.MYGET }}
76+
77+
- name: Push NuGet package to GitHub Packages
78+
run: dotnet nuget push artifacts\*.nupkg --source https://nuget.pkg.github.com/DuendeSoftware/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
83+
- name: Upload artifacts
84+
uses: actions/upload-artifact@v4
85+
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
86+
with:
87+
path: access-token-management/artifacts/*.nupkg
88+
compression-level: 0
89+
overwrite: true
90+
retention-days: 15
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: acces-token-management\codeql
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- .github/workflows/ignore-this-codeql.yml
9+
- ignore-this/*
10+
pull_request:
11+
paths:
12+
- .github/workflows/ignore-this-codeql.yml
13+
- ignore-this/*
14+
schedule:
15+
- cron: '38 15 * * 0'
16+
17+
jobs:
18+
analyze:
19+
name: Analyze
20+
runs-on: ubuntu-latest
21+
permissions:
22+
actions: read
23+
contents: read
24+
security-events: write
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: csharp
34+
35+
- name: Auto build
36+
uses: github/codeql-action/autobuild@v3
37+
38+
- name: Perform CodeQL analysis
39+
uses: github/codeql-action/analyze@v3
40+
with:
41+
category: "/language:csharp"
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: access-token-management\release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
type: string
8+
description: "Version in format X.Y.Z or X.Y.Z-preview.N"
9+
required: true
10+
default: '0.0.0'
11+
12+
env:
13+
DOTNET_NOLOGO: true
14+
15+
defaults:
16+
run:
17+
working-directory: access-token-management
18+
shell: pwsh
19+
20+
jobs:
21+
tag:
22+
name: Tag and Pack
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: write
26+
packages: write
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: |
36+
8.0.x
37+
38+
- name: Tag
39+
run: |
40+
git config --global user.email "github-bot@duendesoftware.com"
41+
git config --global user.name "Duende Software GitHub Bot"
42+
git tag -a it-${{ github.event.inputs.version }} -m "Release v${{ github.event.inputs.version }}"
43+
git push origin it-${{ github.event.inputs.version }}
44+
45+
- name: Pack
46+
run: ./build.ps1 pack
47+
48+
- name: Install Sectigo CodeSiging CA certificates
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install -y ca-certificates
52+
sudo cp build/SectigoPublicCodeSigningRootCrossAAA.crt /usr/local/share/ca-certificates/
53+
sudo update-ca-certificates
54+
55+
- name: Sign
56+
env:
57+
SignClientSecret: ${{ secrets.SignClientSecret }}
58+
run: ./build.ps1 sign
59+
60+
- name: Push packages to MyGet
61+
run: dotnet nuget push artifacts\*.nupkg -s https://www.myget.org/F/duende_identityserver/api/v2/package -k ${{ secrets.MYGET }}
62+
63+
- name: Push packages to GitHub
64+
run: dotnet nuget push artifacts\*.nupkg --source https://nuget.pkg.github.com/DuendeSoftware/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Upload artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
path: access-token-management/artifacts/*.nupkg
73+
compression-level: 0
74+
overwrite: true
75+
retention-days: 15
76+
77+
publish:
78+
name: Publish to NuGet
79+
runs-on: ubuntu-latest
80+
environment: nuget.org
81+
needs: tag
82+
83+
steps:
84+
- uses: actions/download-artifact@v4
85+
86+
- uses: actions/setup-dotnet@v4
87+
with:
88+
dotnet-version: |
89+
8.0.x
90+
91+
- name: Release
92+
#run: dotnet nuget push artifacts\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGETORG_TOKEN }}
93+
run: Write-Host "Release.."

ignore-this/.config/dotnet-tools.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"NuGetKeyVaultSignTool": {
6+
"version": "3.2.3",
7+
"commands": [
8+
"NuGetKeyVaultSignTool"
9+
]
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)