Repository navigation
107 lines (99 loc) · 3.33 KB
/
Copy pathrelease.yml
File metadata and controls
107 lines (99 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Release
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
verify_only:
description: Run all qualification checks without creating a release or publishing packages
type: boolean
default: false
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
verify-and-package:
uses: ./.github/workflows/verify.yml
with:
require_tag: ${{ !inputs.verify_only }}
live_feed: true
stage-packages:
needs: verify-and-package
if: ${{ !inputs.verify_only }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: verified-packages
path: artifacts
- uses: actions/upload-artifact@v4
with:
name: release-packages
path: artifacts/
if-no-files-found: error
github-release:
needs: stage-packages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: release-packages
path: artifacts
- name: Publish GitHub release with VSIX and global tool package
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
shell: bash
run: |
echo 'NuGet Package Manager for VS Code and the nuget-manager global tool share one .NET engine. Both hosts support reviewed updates of complete package families. This release contains the built and tested VSIX and global tool package; Marketplace and NuGet uploads run independently.' > "$RUNNER_TEMP/release-notes.md"
if gh release view "$GITHUB_REF_NAME" > /dev/null 2>&1; then
gh release upload "$GITHUB_REF_NAME" artifacts/*.vsix artifacts/*.nupkg --clobber
gh release edit "$GITHUB_REF_NAME" --prerelease=false --notes-file "$RUNNER_TEMP/release-notes.md"
else
gh release create "$GITHUB_REF_NAME" artifacts/*.vsix artifacts/*.nupkg --title "$GITHUB_REF_NAME" --prerelease=false --notes-file "$RUNNER_TEMP/release-notes.md"
fi
nuget-publish:
needs: stage-packages
runs-on: ubuntu-latest
timeout-minutes: 10
environment: release
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- uses: actions/setup-node@v6
with:
node-version: 22
- uses: actions/download-artifact@v4
with:
name: release-packages
path: artifacts
- name: Publish .NET global tool to NuGet.org
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
shell: bash
run: |
if [[ -z "$NUGET_API_KEY" ]]; then
echo "NUGET_API_KEY is required to publish nuget-manager to NuGet.org." >&2
exit 1
fi
dotnet nuget push artifacts/*.nupkg --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate
marketplace-publish:
needs: github-release
if: vars.MARKETPLACE_PUBLISH == 'true'
permissions:
contents: read
actions: read
id-token: write
uses: ./.github/workflows/marketplace.yml
with:
release_tag: ${{ github.ref_name }}
qualification_run_id: ${{ github.run_id }}
secrets: inherit