-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
16 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,25 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# TODO: revert once we have the PR ready | ||
|
||
permissions: | ||
contents: write | ||
pages: write | ||
id-token: write | ||
on: | ||
pull_request: {} | ||
|
||
jobs: | ||
nuget: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
name: dotnet | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- id: tag | ||
name: Determine tag | ||
run: | | ||
version="$(head -n 1 version.txt)" | ||
ref_name="v$version" | ||
create=true | ||
if [ "$(git ls-remote origin "refs/tags/$ref_name" | wc -l)" = "1" ]; then | ||
create=false | ||
fi | ||
echo "version=$version" | tee -a "$GITHUB_OUTPUT" | ||
echo "ref-name=$ref_name" | tee -a "$GITHUB_OUTPUT" | ||
echo "create=$create" | tee -a "$GITHUB_OUTPUT" | ||
- if: ${{ fromJSON(steps.tag.outputs.create) }} | ||
name: Setup dotnet | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: | | ||
6.x | ||
7.x | ||
- if: ${{ fromJSON(steps.tag.outputs.create) }} | ||
name: Pack | ||
run: dotnet pack -c Release -o dist | ||
|
||
- if: ${{ fromJSON(steps.tag.outputs.create) }} | ||
name: Push | ||
run: dotnet nuget push dist/*.nupkg -s https://api.nuget.org/v3/index.json -k "${{ secrets.NUGET_API_KEY }}" --skip-duplicate | ||
|
||
- if: ${{ fromJSON(steps.tag.outputs.create) }} | ||
run: dotnet tool update -g docfx | ||
|
||
- if: ${{ fromJSON(steps.tag.outputs.create) }} | ||
run: docfx docs/docfx.json | ||
|
||
- if: ${{ fromJSON(steps.tag.outputs.create) }} | ||
name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: docs/_site | ||
|
||
- if: ${{ fromJSON(steps.tag.outputs.create) }} | ||
name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 | ||
dotnet-version: '8.x' | ||
dotnet-quality: 'preview' | ||
|
||
- if: ${{ fromJSON(steps.tag.outputs.create) }} | ||
name: Tag | ||
run: | | ||
git tag "${{ steps.tag.outputs.ref-name }}" | ||
git push origin "${{ steps.tag.outputs.ref-name }}" | ||
- run: dotnet pack -c Release -o dist | ||
- run: dotnet tool update -g docfx | ||
- run: docfx docs/docfx.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters