Skip to content

Commit cf4cfdb

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

23 files changed

+806
-10
lines changed

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

Lines changed: 8 additions & 10 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/*
@@ -23,15 +21,14 @@ on:
2321
env:
2422
DOTNET_NOLOGO: true
2523

26-
defaults:
27-
run:
28-
working-directory: access-token-management
29-
shell: pwsh
30-
3124
jobs:
3225
build:
3326
name: Build
3427
runs-on: ubuntu-latest
28+
defaults:
29+
run:
30+
working-directory: access-token-management
31+
shell: pwsh
3532

3633
steps:
3734
- uses: actions/checkout@v4
@@ -65,24 +62,25 @@ jobs:
6562
sudo update-ca-certificates
6663
6764
- name: Sign
68-
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
65+
if: (github.ref == 'refs/heads/main')
6966
env:
7067
SignClientSecret: ${{ secrets.SignClientSecret }}
7168
run: ./build.ps1 sign
7269

7370
- name: Push packages to MyGet
74-
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
71+
if: (github.ref == 'refs/heads/main')
7572
run: dotnet nuget push artifacts\*.nupkg -s https://www.myget.org/F/duende_identityserver/api/v2/package -k ${{ secrets.MYGET }}
7673

7774
- name: Push NuGet package to GitHub Packages
75+
if: (github.ref == 'refs/heads/main')
7876
run: dotnet nuget push artifacts\*.nupkg --source https://nuget.pkg.github.com/DuendeSoftware/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
7977
env:
8078
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8179
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8280

8381
- name: Upload artifacts
8482
uses: actions/upload-artifact@v4
85-
if: (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
83+
if: (github.ref == 'refs/heads/main')
8684
with:
8785
path: access-token-management/artifacts/*.nupkg
8886
compression-level: 0

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
env:
1313
DOTNET_NOLOGO: true
14+
DOTNET_CLI_TELEMETRY_OPTOUT: true
1415

1516
defaults:
1617
run:

.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+
DOTNET_CLI_TELEMETRY_OPTOUT: true
24+
25+
jobs:
26+
build:
27+
name: Build
28+
runs-on: ubuntu-latest
29+
defaults:
30+
run:
31+
working-directory: ignore-this
32+
shell: pwsh
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')
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')
73+
run: dotnet nuget push artifacts\*.nupkg -s https://www.myget.org/F/duende_identityserver/api/v2/package -k ${{ secrets.MYGET }} --skip-duplicate
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 }} --skip-duplicate
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')
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: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
DOTNET_CLI_TELEMETRY_OPTOUT: true
15+
16+
defaults:
17+
run:
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+
defaults:
28+
run:
29+
working-directory: ignore-this
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- uses: actions/setup-dotnet@v4
37+
with:
38+
dotnet-version: |
39+
8.0.x
40+
41+
- name: Tag
42+
run: |
43+
git config --global user.email "github-bot@duendesoftware.com"
44+
git config --global user.name "Duende Software GitHub Bot"
45+
git tag -a it-${{ github.event.inputs.version }} -m "Release v${{ github.event.inputs.version }}"
46+
git push origin it-${{ github.event.inputs.version }}
47+
48+
- name: Pack
49+
run: build.ps1 pack
50+
51+
- name: Install Sectigo CodeSiging CA certificates
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install -y ca-certificates
55+
sudo cp build/SectigoPublicCodeSigningRootCrossAAA.crt /usr/local/share/ca-certificates/
56+
sudo update-ca-certificates
57+
58+
- name: Sign
59+
env:
60+
SignClientSecret: ${{ secrets.SignClientSecret }}
61+
run: build.ps1 sign
62+
63+
- name: Push packages to MyGet
64+
run: dotnet nuget push artifacts\*.nupkg -s https://www.myget.org/F/duende_identityserver/api/v2/package -k ${{ secrets.MYGET }} --skip-duplicate
65+
66+
- name: Push packages to GitHub
67+
run: dotnet nuget push artifacts\*.nupkg --source https://nuget.pkg.github.com/DuendeSoftware/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
72+
- name: Upload artifacts
73+
uses: actions/upload-artifact@v4
74+
with:
75+
path: ignore-this/artifacts/*.nupkg
76+
compression-level: 0
77+
overwrite: true
78+
retention-days: 15
79+
80+
publish:
81+
name: Publish to NuGet
82+
runs-on: ubuntu-latest
83+
environment: nuget.org
84+
needs: tag
85+
86+
steps:
87+
- uses: actions/download-artifact@v4
88+
with:
89+
path: artifacts
90+
91+
- uses: actions/setup-dotnet@v4
92+
with:
93+
dotnet-version: |
94+
8.0.x
95+
96+
- name: List files
97+
shell: bash
98+
run: tree
99+
100+
- name: Push to nuget.org
101+
run: dotnet nuget push artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }} --skip-duplicate

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)