Skip to content

Commit eddc44c

Browse files
committed
fix: fix release process
1 parent ab29f53 commit eddc44c

File tree

2 files changed

+62
-34
lines changed

2 files changed

+62
-34
lines changed

.github/workflows/release.yml

Lines changed: 60 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
name: release
22
on:
33
release:
4-
types: [published]
4+
types: [published, edited]
55

66
jobs:
7-
release:
7+
build:
88
runs-on: ubuntu-latest
9-
permissions:
10-
contents: write
119
steps:
1210
- uses: actions/checkout@v3
1311
- uses: actions/setup-node@v3
@@ -39,48 +37,83 @@ jobs:
3937
dotnet publish src/docfx -f net7.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r osx-x64 -o drop/publish/osx-x64
4038
mkdir -p drop/bin
4139
40+
- run: zip -r ../../bin/docfx-win-x64-${GITHUB_REF_NAME}.zip .
41+
working-directory: drop/publish/win-x64
42+
- run: zip -r ../../bin/docfx-linux-x64-${GITHUB_REF_NAME}.zip .
43+
working-directory: drop/publish/linux-x64
44+
- run: zip -r ../../bin/docfx-osx-x64-${GITHUB_REF_NAME}.zip .
45+
working-directory: drop/publish/osx-x64
46+
47+
- uses: actions/upload-artifact@v3
48+
with:
49+
name: nuget
50+
path: drop/nuget
51+
52+
- uses: actions/upload-artifact@v3
53+
with:
54+
name: publish
55+
path: drop/publish
56+
57+
sign:
58+
runs-on: windows-latest
59+
needs: build
60+
steps:
61+
- uses: actions/setup-dotnet@v3
62+
with:
63+
dotnet-version: 7.x
64+
65+
- uses: actions/download-artifact@v3
66+
with:
67+
name: nuget
68+
path: drop/nuget
69+
70+
- uses: actions/download-artifact@v3
71+
with:
72+
name: publish
73+
path: drop/publish
74+
4275
- run: dotnet tool install --tool-path . sign --version 0.9.1-beta.23274.1
4376

4477
- run: >
4578
./sign code azure-key-vault
4679
drop/nuget/**/*.*
4780
--description "Docfx code sign"
4881
--description-url "https://dotnet.github.io/docfx"
49-
--azure-key-vault-managed-identity true
5082
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
5183
--azure-key-vault-certificate "${{ secrets.SIGN_KEY_VAULT_CERTIFICATE }}"
5284
--azure-key-vault-tenant-id "${{ secrets.SIGN_KEY_VAULT_TENANT_ID }}"
5385
--azure-key-vault-client-id "${{ secrets.SIGN_KEY_VAULT_CLIENT_ID }}"
5486
--azure-key-vault-client-secret "${{ secrets.SIGN_KEY_VAULT_CLIENT_SECRET }}"
5587
56-
- run: >
57-
./sign code azure-key-vault
58-
bin/**/*.*
59-
--description "Docfx code sign"
60-
--description-url "https://dotnet.github.io/docfx"
61-
--azure-key-vault-managed-identity true
62-
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
63-
--azure-key-vault-certificate "${{ secrets.SIGN_KEY_VAULT_CERTIFICATE }}"
64-
--azure-key-vault-tenant-id "${{ secrets.SIGN_KEY_VAULT_TENANT_ID }}"
65-
--azure-key-vault-client-id "${{ secrets.SIGN_KEY_VAULT_CLIENT_ID }}"
66-
--azure-key-vault-client-secret "${{ secrets.SIGN_KEY_VAULT_CLIENT_SECRET }}"
88+
- uses: actions/upload-artifact@v3
89+
with:
90+
name: nuget-signed
91+
path: drop/nuget
6792

68-
- run: zip -r ../../bin/docfx-win-x64-${GITHUB_REF_NAME}.zip .
69-
working-directory: drop/publish/win-x64
70-
- run: zip -r ../../bin/docfx-linux-x64-${GITHUB_REF_NAME}.zip .
71-
working-directory: drop/publish/linux-x64
72-
- run: zip -r ../../bin/docfx-osx-x64-${GITHUB_REF_NAME}.zip .
73-
working-directory: drop/publish/osx-x64
93+
publish:
94+
runs-on: ubuntu-latest
95+
needs: sign
96+
permissions:
97+
contents: write
98+
steps:
99+
- uses: actions/setup-dotnet@v3
100+
with:
101+
dotnet-version: 7.x
74102

75-
- uses: actions/upload-artifact@v3
103+
- uses: actions/download-artifact@v3
76104
with:
77-
name: nuget
105+
name: nuget-signed
78106
path: drop/nuget
79107

80-
- uses: actions/upload-artifact@v3
108+
- uses: actions/download-artifact@v3
81109
with:
82-
name: bin
83-
path: drop/bin
110+
name: publish
111+
path: drop/publish
112+
113+
- run: |
114+
dotnet nuget push $(Pipeline.Workspace)\nuget\*.nupkg --api-key $env:NUGET_KEY --skip-duplicate --source https://nuget.org
115+
env:
116+
NUGET_KEY: $(NUGET_KEY)
84117
85118
- name: Upload GitHub release
86119
run: |
@@ -89,8 +122,3 @@ jobs:
89122
gh release upload ${GITHUB_REF_NAME} drop/bin/docfx-osx-x64-${GITHUB_REF_NAME}.zip
90123
env:
91124
GH_TOKEN: ${{ github.token }}
92-
93-
- run: |
94-
dotnet nuget push $(Pipeline.Workspace)\nuget\*.nupkg --api-key $env:NUGET_KEY --skip-duplicate --source https://nuget.org
95-
env:
96-
NUGET_KEY: $(NUGET_KEY)

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2626
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2727

28-
<Authors>Microsoft</Authors>
29-
<Company>Microsoft</Company>
28+
<Authors>.NET Foundation and Contributors</Authors>
3029
<Copyright>Copyright (c) .NET Foundation and Contributors</Copyright>
30+
<Description>Technical documentation tool with markdown, API docs for .NET, REST API and more.</Description>
3131

3232
<PackageReadmeFile>README.md</PackageReadmeFile>
3333
<PackageProjectUrl>https://github.com/dotnet/docfx</PackageProjectUrl>

0 commit comments

Comments
 (0)