Skip to content

Commit 03a40f3

Browse files
committed
ci: Move to github actions
1 parent fbdc4e7 commit 03a40f3

File tree

5 files changed

+269
-44
lines changed

5 files changed

+269
-44
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Deploy to nuget.org"
2+
description: "Deploy to nuget.org"
3+
4+
inputs:
5+
token:
6+
description: "The token to use for nuget publishing"
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
12+
steps:
13+
- name: Download Artifacts
14+
uses: actions/download-artifact@v4
15+
with:
16+
name: NuGet-Signed
17+
path: artifacts
18+
19+
- name: NuGet.org Push
20+
shell: pwsh
21+
run: |
22+
dotnet nuget push artifacts/*.nupkg -s https://api.nuget.org/v3/index.json -k "${{ inputs.token }}"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Deploy to nuget.org"
2+
description: "Deploy to nuget.org"
3+
4+
inputs:
5+
token:
6+
description: "The token to use for nuget publishing"
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
12+
steps:
13+
- name: Download Artifacts
14+
uses: actions/download-artifact@v4
15+
with:
16+
name: NuGet-Signed
17+
path: artifacts
18+
19+
- uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: '9.0.x'
22+
23+
- name: Uno NuGet Feed Push
24+
shell: pwsh
25+
run: |
26+
dotnet nuget add source https://pkgs.dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_packaging/unoplatformdev/nuget/v3/index.json -n "dev" --username az --password "${{ inputs.token }}" --store-password-in-clear-text
27+
dotnet nuget push --api-key AZ -s dev artifacts/*.nupkg
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Tag and push to GitHub"
2+
description: "Tag and push to GitHub"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v2
9+
10+
- name: Setup .NET SDK
11+
uses: actions/setup-dotnet@v1
12+
with:
13+
dotnet-version: '9.0.201'
14+
15+
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
16+
name: NBGV
17+
id: nbgv
18+
with:
19+
toolVersion: 3.6.139
20+
setAllVars: true
21+
22+
- name: "Tag and push to GitHub"
23+
shell: pwsh
24+
run: |
25+
git config user.email "[email protected]"
26+
git config user.name "Uno DevOps"
27+
git tag $env:NBGV_SemVer2
28+
git push origin $env:NBGV_SemVer2

.github/workflows/ci.yml

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/*/*
8+
pull_request:
9+
branches:
10+
- main
11+
- release/*/*
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
17+
env:
18+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
19+
DOTNET_NOLOGO: 1
20+
NUGET_XMLDOC_MODE: skip
21+
ARTIFACTS_DIR: artifacts
22+
23+
# Required secrets:
24+
# SIGN_AZURE_CLIENT_ID
25+
# SIGN_AZURE_TENANT_ID
26+
# SIGN_AZURE_SUBSCRIPTION_ID
27+
# SIGN_KEY_VAULT_URL
28+
# SIGN_KEY_VAULT_CERTIFICATE_ID
29+
# UNO_NUGET_FEED_API_KEY
30+
# NUGET_ORG_API_KEY
31+
32+
jobs:
33+
build:
34+
name: Build
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Determine version (NBGV)
43+
id: nbgv
44+
uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
45+
with:
46+
toolVersion: 3.8.118
47+
setAllVars: true
48+
49+
- name: Export informative version
50+
shell: pwsh
51+
run: |
52+
$buildingRef = "${{ github.ref }}"
53+
$informationalVersion = "${{ steps.nbgv.outputs.SemVer2 }}+${{ steps.nbgv.outputs.GitCommitId }}-$buildingRef" -replace 'refs/heads/','' -replace '/','-'
54+
"NBGV_AssemblyInformationalVersion=$informationalVersion" | Out-File -FilePath $env:GITHUB_ENV -Append
55+
56+
- name: Setup .NET
57+
uses: actions/setup-dotnet@v4
58+
with:
59+
dotnet-version: '10.0.x'
60+
61+
- name: Install workloads
62+
run: dotnet workload install wasm-tools wasm-tools-net9
63+
64+
- name: Prepare artifacts directory
65+
run: |
66+
rm -rf "$ARTIFACTS_DIR"
67+
mkdir -p "$ARTIFACTS_DIR/log"
68+
69+
- name: Build solution
70+
run: dotnet build MonacoEditorComponent.slnx -c Release -p:ArtifactsPath="$ARTIFACTS_DIR" /bl:"$ARTIFACTS_DIR/log/build.binlog"
71+
72+
- name: Upload packages
73+
if: always()
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: NuGet
77+
path: artifacts/package/release
78+
if-no-files-found: warn
79+
80+
- name: Upload logs
81+
if: always()
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: logs
85+
path: artifacts/log
86+
if-no-files-found: warn
87+
88+
sign:
89+
name: Sign
90+
runs-on: windows-latest
91+
needs: build
92+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/'))
93+
environment: PackageSign
94+
permissions:
95+
contents: read
96+
id-token: write
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
101+
- name: Download packages
102+
uses: actions/download-artifact@v4
103+
with:
104+
name: NuGet
105+
path: artifacts
106+
107+
- name: Setup .NET
108+
uses: actions/setup-dotnet@v4
109+
with:
110+
dotnet-version: '9.0.x'
111+
112+
- name: Install Sign CLI tool
113+
run: dotnet tool install --tool-path . sign --version 0.9.1-beta.25278.1
114+
115+
- name: Az CLI login
116+
uses: azure/login@v2
117+
with:
118+
allow-no-subscriptions: true
119+
client-id: ${{ secrets.SIGN_AZURE_CLIENT_ID }}
120+
tenant-id: ${{ secrets.SIGN_AZURE_TENANT_ID }}
121+
subscription-id: ${{ secrets.SIGN_AZURE_SUBSCRIPTION_ID }}
122+
123+
- name: Sign artifacts
124+
shell: pwsh
125+
run: >-
126+
./sign code azure-key-vault artifacts/**/*.nupkg --publisher-name "uno.monaco-editor-uwp"
127+
--description "Uno Monaco Editor UWP"
128+
--description-url "https://github.com/${{ github.repository }}"
129+
--azure-key-vault-managed-identity true
130+
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
131+
--azure-key-vault-certificate "${{ secrets.SIGN_KEY_VAULT_CERTIFICATE_ID }}"
132+
--verbosity information
133+
134+
- name: Upload signed packages
135+
uses: actions/upload-artifact@v4
136+
with:
137+
name: NuGet-Signed
138+
path: artifacts
139+
140+
publish_dev:
141+
name: Publish Dev
142+
runs-on: ubuntu-latest
143+
needs: sign
144+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
145+
steps:
146+
- name: Checkout
147+
uses: actions/checkout@v4
148+
149+
- name: Uno feed publish
150+
uses: ./.github/actions/nuget-uno-publish
151+
with:
152+
token: ${{ secrets.UNO_NUGET_FEED_API_KEY }}
153+
154+
- name: nuget.org publish
155+
uses: ./.github/actions/nuget-org-publish
156+
with:
157+
token: ${{ secrets.NUGET_ORG_API_KEY }}
158+
159+
publish_release_uno:
160+
name: Publish Internal Feed
161+
runs-on: ubuntu-latest
162+
environment: Stable
163+
needs: sign
164+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/')
165+
steps:
166+
- name: Checkout
167+
uses: actions/checkout@v4
168+
169+
- name: Uno feed publish
170+
uses: ./.github/actions/nuget-uno-publish
171+
with:
172+
token: ${{ secrets.UNO_NUGET_FEED_API_KEY }}
173+
174+
publish_release_nuget_org:
175+
name: Publish Production
176+
runs-on: ubuntu-latest
177+
environment: Stable
178+
needs: publish_release_uno
179+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/')
180+
permissions:
181+
contents: write
182+
steps:
183+
- name: Checkout
184+
uses: actions/checkout@v4
185+
186+
- name: nuget.org publish
187+
uses: ./.github/actions/nuget-org-publish
188+
with:
189+
token: ${{ secrets.NUGET_ORG_API_KEY }}
190+
191+
- name: Tag Release
192+
uses: ./.github/actions/tag-release

.vsts-ci.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)