Skip to content

Commit

Permalink
GH workflow with .NET 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk committed Oct 26, 2023
1 parent b9398db commit 31ca589
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.x'
dotnet-version: '8.x'
dotnet-quality: 'preview'

- name: Release Build
run: dotnet build -c Release tests/NATS.Client.Perf/NATS.Client.Perf.csproj
Expand Down
70 changes: 10 additions & 60 deletions .github/workflows/release.yml
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
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.x'
dotnet-version: '8.x'
dotnet-quality: 'preview'

- name: Build
run: dotnet build -c Debug
Expand Down Expand Up @@ -79,7 +80,8 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.x'
dotnet-version: '8.x'
dotnet-quality: 'preview'

- name: Get nats-server
shell: bash
Expand Down

0 comments on commit 31ca589

Please sign in to comment.