mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00
129 lines
2.9 KiB
YAML
129 lines
2.9 KiB
YAML
name: Publish
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
|
|
|
jobs:
|
|
|
|
###################################################
|
|
# DOCS
|
|
###################################################
|
|
|
|
docs:
|
|
name: Documentation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@master
|
|
|
|
- name: Setup dotnet 5.0.301
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 5.0.301
|
|
|
|
- name: Setup dotnet 6.0.100
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 6.0.100
|
|
|
|
- name: Build
|
|
shell: bash
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
cd docs
|
|
dotnet tool restore
|
|
dotnet run --configuration Release
|
|
|
|
###################################################
|
|
# BUILD
|
|
###################################################
|
|
|
|
build:
|
|
name: Build
|
|
needs: [docs]
|
|
if: "!contains(github.event.head_commit.message, 'skip-ci') || startsWith(github.ref, 'refs/tags/')"
|
|
strategy:
|
|
matrix:
|
|
kind: ['linux', 'windows', 'macOS']
|
|
include:
|
|
- kind: linux
|
|
os: ubuntu-latest
|
|
- kind: windows
|
|
os: windows-latest
|
|
- kind: macOS
|
|
os: macos-latest
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup dotnet 3.1.402
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 3.1.402
|
|
|
|
- name: Setup dotnet 5.0.301
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 5.0.301
|
|
|
|
- name: Setup dotnet 6.0.100
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 6.0.100
|
|
|
|
- name: Build
|
|
shell: bash
|
|
run: |
|
|
dotnet tool restore
|
|
dotnet cake
|
|
|
|
###################################################
|
|
# PUBLISH
|
|
###################################################
|
|
|
|
publish:
|
|
name: Publish
|
|
needs: [build]
|
|
if: "!contains(github.event.head_commit.message, 'skip-ci') || startsWith(github.ref, 'refs/tags/')"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup dotnet 3.1.402
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 3.1.402
|
|
|
|
- name: Setup dotnet 5.0.301
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 5.0.301
|
|
|
|
- name: Setup dotnet 6.0
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 6.0.x
|
|
include-prerelease: true
|
|
|
|
- name: Publish
|
|
shell: bash
|
|
run: |
|
|
dotnet tool restore
|
|
dotnet cake --target="publish" \
|
|
--nuget-key="${{secrets.NUGET_API_KEY}}" \
|
|
--github-key="${{secrets.GITHUB_TOKEN}}" |