Skip to content

docs(src/knifehub.web): csproj,html: 1.6.1 #29

docs(src/knifehub.web): csproj,html: 1.6.1

docs(src/knifehub.web): csproj,html: 1.6.1 #29

name: KnifeHub Release
on:
push:
tags:
- "KnifeHub-v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
# 为了让 git 有日志 (git log) 可寻,还得在检出的时候顺带把所有提交历史一并拉下来,指定 fetch-depth 就能做到
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: TimeZone
run: |
echo "Before:"
date --iso-8601=seconds
ls -l /etc/localtime
# Setting TimeZone
sudo rm -f /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "After:"
ls -l /etc/localtime
date --iso-8601=seconds
shell: bash
- name: Set outputs
id: vars
run: |
tagPrefix=refs/tags/KnifeHub-
# 获取字符串长度
tagPrefixLen=${#tagPrefix}
# 去掉前面的 refs/tags/KnifeHub-
RELEASE_VERSION=${GITHUB_REF:$tagPrefixLen}
# 提取出 v1.0.0
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
shell: bash
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.100
7.0.401
8.0.201
- name: Build
run: |
cd ./src/KnifeHub.Web
# win-x64
dotnet publish --framework net6.0 --configuration Release --runtime win-x64 -p:PublishSingleFile=true --output ../../net6.0-win-x64 --self-contained true
dotnet publish --framework net7.0 --configuration Release --runtime win-x64 -p:PublishSingleFile=true --output ../../net7.0-win-x64 --self-contained true
dotnet publish --framework net8.0 --configuration Release --runtime win-x64 -p:PublishSingleFile=true --output ../../net8.0-win-x64 --self-contained true
# win-x86
dotnet publish --framework net6.0 --configuration Release --runtime win-x86 -p:PublishSingleFile=true --output ../../net6.0-win-x86 --self-contained true
dotnet publish --framework net7.0 --configuration Release --runtime win-x86 -p:PublishSingleFile=true --output ../../net7.0-win-x86 --self-contained true
dotnet publish --framework net8.0 --configuration Release --runtime win-x86 -p:PublishSingleFile=true --output ../../net8.0-win-x86 --self-contained true
# linux-x64
dotnet publish --framework net6.0 --configuration Release --runtime linux-x64 -p:PublishSingleFile=true --output ../../net6.0-linux-x64 --self-contained true
dotnet publish --framework net7.0 --configuration Release --runtime linux-x64 -p:PublishSingleFile=true --output ../../net7.0-linux-x64 --self-contained true
dotnet publish --framework net8.0 --configuration Release --runtime linux-x64 -p:PublishSingleFile=true --output ../../net8.0-linux-x64 --self-contained true
# linux-arm
dotnet publish --framework net6.0 --configuration Release --runtime linux-arm -p:PublishSingleFile=true --output ../../net6.0-linux-arm --self-contained true
dotnet publish --framework net7.0 --configuration Release --runtime linux-arm -p:PublishSingleFile=true --output ../../net7.0-linux-arm --self-contained true
dotnet publish --framework net8.0 --configuration Release --runtime linux-arm -p:PublishSingleFile=true --output ../../net8.0-linux-arm --self-contained true
# linux-arm64
dotnet publish --framework net6.0 --configuration Release --runtime linux-arm64 -p:PublishSingleFile=true --output ../../net6.0-linux-arm64 --self-contained true
dotnet publish --framework net7.0 --configuration Release --runtime linux-arm64 -p:PublishSingleFile=true --output ../../net7.0-linux-arm64 --self-contained true
dotnet publish --framework net8.0 --configuration Release --runtime linux-arm64 -p:PublishSingleFile=true --output ../../net8.0-linux-arm64 --self-contained true
# osx-x64
dotnet publish --framework net6.0 --configuration Release --runtime osx-x64 -p:PublishSingleFile=true --output ../../net6.0-osx-x64 --self-contained true
dotnet publish --framework net7.0 --configuration Release --runtime osx-x64 -p:PublishSingleFile=true --output ../../net7.0-osx-x64 --self-contained true
dotnet publish --framework net8.0 --configuration Release --runtime osx-x64 -p:PublishSingleFile=true --output ../../net8.0-osx-x64 --self-contained true
# osx.10.10-x64
dotnet publish --framework net6.0 --configuration Release --runtime osx.10.10-x64 -p:PublishSingleFile=true --output ../../net6.0-osx.10.10-x64 --self-contained true
dotnet publish --framework net7.0 --configuration Release --runtime osx.10.10-x64 -p:PublishSingleFile=true --output ../../net7.0-osx.10.10-x64 --self-contained true
dotnet publish --framework net8.0 --configuration Release --runtime osx.10.10-x64 -p:PublishSingleFile=true --output ../../net8.0-osx.10.10-x64 --self-contained true
- name: Zip the Build
run: |
# win-x64
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-win-x64.zip ./net6.0-win-x64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-win-x64.zip ./net7.0-win-x64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-win-x64.zip ./net8.0-win-x64/
# win-x86
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-win-x86.zip ./net6.0-win-x86/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-win-x86.zip ./net7.0-win-x86/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-win-x86.zip ./net8.0-win-x86/
# linux-x64
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-linux-x64.zip ./net6.0-linux-x64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-linux-x64.zip ./net7.0-linux-x64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-linux-x64.zip ./net8.0-linux-x64/
# linux-arm
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-linux-arm.zip ./net6.0-linux-arm/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-linux-arm.zip ./net7.0-linux-arm/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-linux-arm.zip ./net8.0-linux-arm/
# linux-arm64
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-linux-arm64.zip ./net6.0-linux-arm64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-linux-arm64.zip ./net7.0-linux-arm64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-linux-arm64.zip ./net8.0-linux-arm64/
# osx-x64
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-osx-x64.zip ./net6.0-osx-x64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-osx-x64.zip ./net7.0-osx-x64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-osx-x64.zip ./net8.0-osx-x64/
# osx.10.10-x64
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-osx.10.10-x64.zip ./net6.0-osx.10.10-x64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-osx.10.10-x64.zip ./net7.0-osx.10.10-x64/
zip -r KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-osx.10.10-x64.zip ./net8.0-osx.10.10-x64/
- name: Create temp-release-note.md
run: |
cp utils/generate-release-note.ps1 generate-release-note.ps1
$env:GitProjectTagName="KnifeHub"
$env:GitProjectPath="src/KnifeHub.Web/*"
./generate-release-note.ps1
shell: pwsh
- name: Create Release and Upload Release Asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
#tag_name: ${{ github.ref }}
#name: ${{ github.ref }}
# body: TODO New Release.
body_path: temp-release-note.md
draft: false
prerelease: false
files: |
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-win-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-win-x86.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-linux-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-linux-arm.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-linux-arm64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-osx-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0-osx.10.10-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-win-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-win-x86.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-linux-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-linux-arm.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-linux-arm64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-osx-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net7.0-osx.10.10-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-win-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-win-x86.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-linux-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-linux-arm.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-linux-arm64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-osx-x64.zip
KnifeHub-${{ steps.vars.outputs.RELEASE_VERSION }}-net8.0-osx.10.10-x64.zip
README.md
LICENSE