mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-13 15:42:50 +08:00

* Update .NET SDK to 9.0.100 * Remove net6.0 * Remove net7.0 * Update dependencies * Install correct .NET SDK:s in GitHub Actions
84 lines
2.0 KiB
YAML
84 lines
2.0 KiB
YAML
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
name: Publish
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
|
|
|
jobs:
|
|
|
|
###################################################
|
|
# PUBLISH
|
|
###################################################
|
|
|
|
build:
|
|
name: Publish NuGet Packages
|
|
if: "!contains(github.event.head_commit.message, 'skip-ci') || startsWith(github.ref, 'refs/tags/')"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: |
|
|
8.0.x
|
|
9.0.x
|
|
|
|
- name: Publish
|
|
shell: bash
|
|
run: |
|
|
dotnet tool restore
|
|
dotnet cake --target="publish" \
|
|
--nuget-key="${{secrets.NUGET_API_KEY}}" \
|
|
--github-key="${{secrets.GITHUB_TOKEN}}"
|
|
|
|
###################################################
|
|
# DOCS
|
|
###################################################
|
|
|
|
documentation:
|
|
name: Publish Documentation
|
|
needs: [build]
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '16'
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.npm
|
|
key: npm-${{ hashFiles('package-lock.json') }}
|
|
restore-keys: npm-
|
|
|
|
- name: Publish Documentation
|
|
shell: bash
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NETLIFY_ACCESS_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }}
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
run: |
|
|
cd docs
|
|
dotnet tool restore
|
|
dotnet run --configuration Release -- deploy |