submodule对gitea不管用,所以直接拉了一份拉格兰
This commit is contained in:
76
Lagrange.Core/.github/workflows/Lagrange.OneBot-release.yml
vendored
Normal file
76
Lagrange.Core/.github/workflows/Lagrange.OneBot-release.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
name: Lagrange.OneBot Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
jobs:
|
||||
delete-tag:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- run: gh release delete nightly --cleanup-tag -y -R ${{ github.repository }}
|
||||
|
||||
create-tag:
|
||||
needs:
|
||||
- delete-tag
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- run: echo -e "> ⚠️This is a nightly release.\r\n> ⚠️This is not the latest version." > note
|
||||
|
||||
- run: gh release create nightly -F ./note -p -t "Nightly Release" -R ${{ github.repository }}
|
||||
|
||||
build-and-upload-release:
|
||||
if: ${{ always() }}
|
||||
|
||||
needs:
|
||||
- create-tag
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
runtimeIdentifier:
|
||||
[
|
||||
win-x64,
|
||||
win-x86,
|
||||
linux-x64,
|
||||
linux-arm,
|
||||
linux-arm64,
|
||||
osx-x64,
|
||||
osx-arm64,
|
||||
linux-musl-x64,
|
||||
linux-musl-arm,
|
||||
linux-musl-arm64,
|
||||
]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
|
||||
- run: dotnet publish Lagrange.OneBot/Lagrange.OneBot.csproj --self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none -p:RuntimeIdentifier=${{ matrix.runtimeIdentifier }} --framework net9.0
|
||||
|
||||
- run: |
|
||||
if [[ ${{ matrix.runtimeIdentifier }} == 'win-x64' || ${{ matrix.runtimeIdentifier }} == 'win-x86' ]]; then
|
||||
zip -r Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_SelfContained.zip ./Lagrange.OneBot/bin/Release/net9.0/${{ matrix.runtimeIdentifier }}/publish
|
||||
gh release upload nightly Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_SelfContained.zip -R ${{ github.repository }}
|
||||
else
|
||||
tar -czvf Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_SelfContained.tar.gz ./Lagrange.OneBot/bin/Release/net9.0/${{ matrix.runtimeIdentifier }}/publish
|
||||
gh release upload nightly Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_net9.0_SelfContained.tar.gz -R ${{ github.repository }}
|
||||
fi
|
||||
Reference in New Issue
Block a user