Skip to content

Commit 38ba3c2

Browse files
authored
Publish samples to cloud storage (#8166)
* Build samples and Azure login * Attempt the upload * Didn't recognize PWD? * Just use bash * Auth mode param * No progress, formatting, test overwrite * Whoopsie * Change to push to master * Concurrency control * Remove artifact
1 parent 4bffd9f commit 38ba3c2

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish
2+
on:
3+
push:
4+
branches: master
5+
env:
6+
DOTNET_NOLOGO: true
7+
permissions:
8+
id-token: write
9+
concurrency:
10+
group: publish
11+
cancel-in-progress: true
12+
defaults:
13+
run:
14+
shell: bash
15+
jobs:
16+
publish-samples:
17+
name: Publish Samples
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
- name: Setup .NET SDK
23+
uses: actions/setup-dotnet@v5.2.0
24+
with:
25+
global-json-file: global.json
26+
# Caching is done to limit data transfer on each PR, not to optimize CI speed
27+
- name: Check docstool version for cache
28+
run: |
29+
curl --connect-timeout 5 --max-time 15 --silent --show-error https://f.feedz.io/particular-software/packages/nuget/v3/packages/particular.docstool/index.json >> docstool-versions.json
30+
- name: Cache docstool
31+
id: cache-docstool
32+
uses: actions/cache@v5.0.4
33+
with:
34+
path: |
35+
~/.dotnet/tools/docstool
36+
~/.dotnet/tools/.store/particular.docstool
37+
key: docstool-${{ hashFiles('docstool-versions.json') }}
38+
- name: Install docstool
39+
if: steps.cache-docstool.outputs.cache-hit != 'true'
40+
run: dotnet tool install Particular.DocsTool --global --add-source https://f.feedz.io/particular-software/packages/nuget/index.json
41+
- name: Run docstool
42+
run: docstool test --no-version-check --zipfiles --out ~/build-output
43+
- name: Azure Login
44+
uses: azure/login@v3
45+
with:
46+
client-id: ${{ secrets.AZURE_OPENID_CLIENT_ID }}
47+
tenant-id: ${{ secrets.AZURE_OPENID_TENANT_ID }}
48+
subscription-id: ${{ secrets.AZURE_OPENID_SUBSCRIPTION_ID }}
49+
- name: Publish Samples
50+
shell: pwsh
51+
run: az storage blob upload-batch `
52+
--source ~/build-output `
53+
--destination zips `
54+
--account-name particulardocs `
55+
--pattern "*.zip" `
56+
--overwrite `
57+
--auth-mode login `
58+
--no-progress

0 commit comments

Comments
 (0)