11name : release
22on :
33 release :
4- types : [published]
4+ types : [published, edited ]
55
66jobs :
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
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+ - uses : actions/upload-artifact@v3
41+ with :
42+ name : nuget
43+ path : drop/nuget
44+
45+ - uses : actions/upload-artifact@v3
46+ with :
47+ name : publish
48+ path : drop/publish
49+
50+ sign :
51+ runs-on : windows-latest
52+ needs : build
53+ steps :
54+ - uses : actions/setup-dotnet@v3
55+ with :
56+ dotnet-version : 7.x
57+
58+ - uses : actions/download-artifact@v3
59+ with :
60+ name : nuget
61+ path : drop/nuget
62+
63+ - uses : actions/download-artifact@v3
64+ with :
65+ name : publish
66+ path : drop/publish
67+
4268 - run : dotnet tool install --tool-path . sign --version 0.9.1-beta.23274.1
4369
4470 - run : >
@@ -65,22 +91,47 @@ jobs:
6591 --azure-key-vault-client-id "${{ secrets.SIGN_KEY_VAULT_CLIENT_ID }}"
6692 --azure-key-vault-client-secret "${{ secrets.SIGN_KEY_VAULT_CLIENT_SECRET }}"
6793
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
74-
7594 - uses : actions/upload-artifact@v3
7695 with :
77- name : nuget
96+ name : nuget-signed
7897 path : drop/nuget
7998
8099 - uses : actions/upload-artifact@v3
81100 with :
82- name : bin
83- path : drop/bin
101+ name : publish-signed
102+ path : drop/publish
103+
104+ publish :
105+ runs-on : ubuntu-latest
106+ needs : sign
107+ permissions :
108+ contents : write
109+ steps :
110+ - uses : actions/setup-dotnet@v3
111+ with :
112+ dotnet-version : 7.x
113+
114+ - uses : actions/download-artifact@v3
115+ with :
116+ name : nuget-signed
117+ path : drop/nuget
118+
119+ - uses : actions/download-artifact@v3
120+ with :
121+ name : publish-signed
122+ path : drop/publish
123+
124+ - run : |
125+ dotnet nuget push $(Pipeline.Workspace)\nuget\*.nupkg --api-key $env:NUGET_KEY --skip-duplicate --source https://nuget.org
126+ env:
127+ NUGET_KEY: $(NUGET_KEY)
128+
129+ - run : zip -r ../../bin/docfx-win-x64-${GITHUB_REF_NAME}.zip .
130+ working-directory : drop/publish/win-x64
131+ - run : zip -r ../../bin/docfx-linux-x64-${GITHUB_REF_NAME}.zip .
132+ working-directory : drop/publish/linux-x64
133+ - run : zip -r ../../bin/docfx-osx-x64-${GITHUB_REF_NAME}.zip .
134+ working-directory : drop/publish/osx-x64
84135
85136 - name : Upload GitHub release
86137 run : |
89140 gh release upload ${GITHUB_REF_NAME} drop/bin/docfx-osx-x64-${GITHUB_REF_NAME}.zip
90141 env :
91142 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)
0 commit comments