Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih committed Nov 7, 2023
1 parent 1d7b96c commit 42bdd47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 103 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ jobs:
with:
lfs: true

- run: echo ${GITHUB_REF_NAME#v}

- uses: ./.github/actions/build

- name: dotnet pack
run: dotnet pack -c Release /p:Version=2.73.1 -o drop/nuget

- run: npm run lint
shell: bash
working-directory: templates
Expand Down
107 changes: 4 additions & 103 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,112 +8,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
7.x
8.0.100-rc.2.23502.2
- run: npm install
working-directory: templates

- run: npm run lint
working-directory: templates

- run: npm run build
working-directory: templates

- name: dotnet pack
run: dotnet pack -c Release /p:Version=${GITHUB_REF_NAME#v} -o drop/nuget

- name: dotnet publish
run: |
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r win-x64 -o drop/publish/win-x64 /p:PlaywrightPlatform=win
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r linux-x64 -o drop/publish/linux-x64 /p:PlaywrightPlatform=linux
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r osx-x64 -o drop/publish/osx-x64 /p:PlaywrightPlatform=osx
mkdir -p drop/bin
- run: zip -r ../../bin/docfx-win-x64-${GITHUB_REF_NAME}.zip .
working-directory: drop/publish/win-x64
- run: zip -r ../../bin/docfx-linux-x64-${GITHUB_REF_NAME}.zip .
working-directory: drop/publish/linux-x64
- run: zip -r ../../bin/docfx-osx-x64-${GITHUB_REF_NAME}.zip .
working-directory: drop/publish/osx-x64

- uses: actions/upload-artifact@v3
with:
name: nuget
path: drop/nuget

- uses: actions/upload-artifact@v3
with:
name: bin
path: drop/bin

sign:
runs-on: windows-latest
needs: build
steps:
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x

- uses: actions/download-artifact@v3
with:
name: nuget
path: drop/nuget

- run: dotnet tool install --tool-path . sign --version 0.9.1-beta.23356.1

- run: >
./sign code azure-key-vault
drop/nuget/**/*.*
--description "Docfx code sign"
--description-url "https://dotnet.github.io/docfx"
--timestamp-url http://timestamp.digicert.com
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
--azure-key-vault-certificate "${{ secrets.SIGN_KEY_VAULT_CERTIFICATE }}"
--azure-key-vault-tenant-id "${{ secrets.SIGN_KEY_VAULT_TENANT_ID }}"
--azure-key-vault-client-id "${{ secrets.SIGN_KEY_VAULT_CLIENT_ID }}"
--azure-key-vault-client-secret "${{ secrets.SIGN_KEY_VAULT_CLIENT_SECRET }}"
- uses: actions/upload-artifact@v3
with:
name: nuget-signed
path: drop/nuget

publish:
runs-on: ubuntu-latest
needs: sign
permissions:
contents: write
steps:
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x

- uses: actions/download-artifact@v3
with:
name: nuget-signed
path: drop/nuget

- uses: actions/download-artifact@v3
with:
name: bin
path: drop/bin

- name: Publish NuGet packages
run: |
dotnet nuget push drop/nuget/*.nupkg --api-key "${{ secrets.NUGET_KEY }}" --skip-duplicate --source https://api.nuget.org/v3/index.json
- name: Upload GitHub release
run: |
gh release upload --repo dotnet/docfx ${GITHUB_REF_NAME} drop/bin/docfx-win-x64-${GITHUB_REF_NAME}.zip
gh release upload --repo dotnet/docfx ${GITHUB_REF_NAME} drop/bin/docfx-linux-x64-${GITHUB_REF_NAME}.zip
gh release upload --repo dotnet/docfx ${GITHUB_REF_NAME} drop/bin/docfx-osx-x64-${GITHUB_REF_NAME}.zip
env:
GH_TOKEN: ${{ github.token }}
- run: |
echo ${GITHUB_REF_NAME#v}
echo ${GITHUB_REF_NAME}
dotnet pack -c Release /p:Version=${GITHUB_REF_NAME#v} -o drop/nuget

0 comments on commit 42bdd47

Please sign in to comment.