-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(.github/workflows/): qQStat4SoraPlugin-release.yml
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: QQStat4SoraPlugin Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "QQStat4SoraPlugin-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: Set outputs | ||
id: vars | ||
run: | | ||
tagPrefix=refs/tags/QQStat4SoraPlugin- | ||
# 获取字符串长度 | ||
tagPrefixLen=${#tagPrefix} | ||
# 去掉前面的 refs/tags/QQStat4SoraPlugin- | ||
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 | ||
|
||
- name: Build | ||
run: | | ||
cd ./plugins/QQStat4SoraPlugin | ||
dotnet build --configuration Release | ||
ls | ||
ls ./bin/Release/ | ||
ls ./bin/Release/net6.0/ | ||
shell: bash | ||
|
||
- name: Zip the Build | ||
run: | | ||
cd ./plugins/QQStat4SoraPlugin/bin/Release/net6.0 | ||
zip -r QQStat4SoraPlugin-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0.zip * | ||
shell: bash | ||
|
||
- name: Create temp-release-note.md | ||
run: | | ||
cp utils/generate-release-note.ps1 generate-release-note.ps1 | ||
$env:GitProjectTagName="QQStat4SoraPlugin" | ||
$env:GitProjectPath="plugins/QQStat4SoraPlugin/*" | ||
./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: | | ||
./plugins/QQStat4SoraPlugin/bin/Release/net6.0/QQStat4SoraPlugin-${{ steps.vars.outputs.RELEASE_VERSION }}-net6.0.zip | ||
./plugins/QQStat4SoraPlugin/README.md | ||
./plugins/QQStat4SoraPlugin/LICENSE |