Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan04 committed Feb 23, 2024
2 parents 2aa0ad8 + aaf9dcc commit 7942d37
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/Lagrange.OneBot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,63 @@ jobs:
with:
name: Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_8.0
path: Lagrange.OneBot/bin/Release/net8.0/${{ matrix.runtimeIdentifier }}/publish

- name: Compress files (Not Windows)
if: matrix.runtimeIdentifier != 'win-x64' && matrix.runtimeIdentifier != 'win-x86'
run: |
Compress-Archive -Path 'Lagrange.OneBot\bin\Release\net8.0\${{ matrix.runtimeIdentifier }}\publish\Lagrange.OneBot' -DestinationPath 'Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_8.0.zip'
- name: Compress files (Windows)
if: matrix.runtimeIdentifier == 'win-x64' || matrix.runtimeIdentifier == 'win-x86'
run: |
Compress-Archive -Path 'Lagrange.OneBot\bin\Release\net8.0\${{ matrix.runtimeIdentifier }}\publish\Lagrange.OneBot.exe' -DestinationPath 'Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_8.0.zip'
- name: Prepare release files
uses: actions/upload-artifact@v3
with:
name: Lagrange.OneBot_all
path: Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_8.0.zip

NightlyRelease:
name: Nightly Release
runs-on: ubuntu-latest
needs: Build
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update Nightly Tag
run: |
git tag -f nightly
git push -f origin nightly
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: Lagrange.OneBot_all
path: ./bin
- name: Update Nightly Release
uses: ncipollo/release-action@v1
with:
tag: nightly
name: 'Nightly Release'
prerelease: true
body: '> ⚠️This is a nightly release.'
artifacts: |
./bin/*
allowUpdates: true
removeArtifacts: true

ClearTempArtifacts:
name: Clear Temp Artifacts
if: always()
runs-on: ubuntu-latest
needs:
- NightlyRelease
permissions:
actions: write
steps:
- uses: geekyeggo/delete-artifact@v2
with:
name: |
Lagrange.OneBot_all
2 changes: 1 addition & 1 deletion Lagrange.OneBot/Message/MessageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void OnFriendMessageReceived(BotContext bot, FriendMessageEvent e)
public OneBotPrivateMsg ConvertToPrivateMsg(uint uin, MessageChain chain, int hash)
{
var segments = Convert(chain);
var request = new OneBotPrivateMsg(uin, new OneBotSender(chain.FriendUin, chain.FriendInfo?.Nickname ?? string.Empty), "private")
var request = new OneBotPrivateMsg(uin, new OneBotSender(chain.FriendUin, chain.FriendInfo?.Nickname ?? string.Empty), "friend")
{
MessageId = hash,
UserId = chain.FriendUin,
Expand Down

0 comments on commit 7942d37

Please sign in to comment.