Skip to content

Commit c3d148d

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

22 files changed

+788
-2
lines changed

.github/workflows/access-token-management-ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ on:
1010
push:
1111
branches:
1212
- main
13-
tags:
14-
- access-token-management-v*
1513
paths:
1614
- .github/workflows/access-token-management-ci.yml
1715
- access-token-management/*

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

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: ignore-this\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+
paths:
14+
- .github/workflows/aignore-this-ci.yml
15+
- ignore-this/*
16+
pull_request:
17+
paths:
18+
- .github/workflows/ignore-this-ci.yml
19+
- ignore-this/*
20+
21+
env:
22+
DOTNET_NOLOGO: true
23+
24+
defaults:
25+
run:
26+
working-directory: ignore-this
27+
shell: pwsh
28+
29+
jobs:
30+
build:
31+
name: Build
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
39+
- uses: actions/setup-dotnet@v4
40+
with:
41+
dotnet-version: |
42+
8.0.x
43+
44+
- name: Build
45+
run: ./build.ps1
46+
47+
- name: Test report
48+
id: test-report
49+
uses: dorny/test-reporter@v1
50+
if: success() || failure() # run this step even if previous step failed
51+
with:
52+
name: Test results
53+
path: ignore-this/test/IgnoreThis.Tests/TestResults/Test.trx
54+
reporter: dotnet-trx
55+
fail-on-error: true
56+
fail-on-empty: true
57+
58+
- name: Install Sectigo CodeSiging CA certificates
59+
run: |
60+
sudo apt-get update
61+
sudo apt-get install -y ca-certificates
62+
sudo cp build/SectigoPublicCodeSigningRootCrossAAA.crt /usr/local/share/ca-certificates/
63+
sudo update-ca-certificates
64+
65+
- name: Sign
66+
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
67+
env:
68+
SignClientSecret: ${{ secrets.SignClientSecret }}
69+
run: ./build.ps1 sign
70+
71+
- name: Push packages to MyGet
72+
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
73+
run: dotnet nuget push artifacts\*.nupkg -s https://www.myget.org/F/duende_identityserver/api/v2/package -k ${{ secrets.MYGET }}
74+
75+
- name: Push NuGet package to GitHub Packages
76+
run: dotnet nuget push artifacts\*.nupkg --source https://nuget.pkg.github.com/DuendeSoftware/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- name: Upload artifacts
82+
uses: actions/upload-artifact@v4
83+
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
84+
with:
85+
path: ignore-this/artifacts/*.nupkg
86+
compression-level: 0
87+
overwrite: true
88+
retention-days: 15
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: ignore-this\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: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: ignore-this\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: ignore-this
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.NUGET_ORG_API_KEY }}

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)