Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix long uid crash and no data issue #12

Merged
merged 4 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .github/workflows/codeql.yml

This file was deleted.

7 changes: 2 additions & 5 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ on:
push:
branches: [ "main" ]
paths-ignore:
- '.github/workflows/codeql.yml'
pull_request:
branches: [ "main" ]
paths-ignore:
- '.github/workflows/codeql.yml'
- '.github/workflows/*'
- '!.github/workflows/ios.yml'

jobs:
build:
Expand Down
56 changes: 49 additions & 7 deletions .github/workflows/status-check.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,72 @@
name: Status Check Workflow

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
on:
workflow_dispatch:
inputs:
psha:
required: true

jobs:
build:
name: Check Build
runs-on: macos-13
permissions:
checks: write
statuses: write
env:
FIN_STATUS: "error"
GH_TOKEN: ${{ github.token }}
steps:
- name: Update Check Status
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/$GITHUB_SHA \
-f state='pending' \
-f target_url='https://github.com/Darock-Studio/Darock-Bili/actions/runs/${{ github.run_id }}' \
-f description='Building...' \
-f context='API Status Checker'

- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.psha }}

- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app

- name: Get Current Time
id: current-time
run: echo "time=$(date +"%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT

- name: Cache Build Caches
uses: actions/cache@v3
with:
key: check-build-cache
key: ${{ runner.os }}-check-build-cache-${{ steps.current-time.outputs.time }}
path: |
~/Library/Developer/Xcode/DerivedData
restore-keys: |
${{ runner.os }}-check-build-cache-

- name: Update Status Env
run: echo "FIN_STATUS=failure" >> $GITHUB_ENV

- name: Build DarockBili App
run: |
xcodebuild -scheme 'DarockBili Watch App' -configuration Release build CODE_SIGN_IDENTITY=""

echo "FIN_STATUS=success" >> $GITHUB_ENV

- name: Update Check Status
if: always()
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/$GITHUB_SHA \
-f state='${{ env.FIN_STATUS }}' \
-f target_url='https://github.com/Darock-Studio/Darock-Bili/actions/runs/${{ github.run_id }}' \
-f context='API Status Checker'

53 changes: 53 additions & 0 deletions .github/workflows/statuscheck-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Status Check Runner

on:
issue_comment:
types:
- created

jobs:
checkif:
runs-on: ubuntu-latest
name: Check Comment Content
outputs:
shouldc: ${{ steps.checkc.outputs.shouldc }}
steps:
- name: Check
id: checkc
run: |
if [[ "${{ github.event.comment.body }}" != *"!Run check"* ]]; then
echo "The comment content does not contain the specified text. Cancelling workflow."
echo "::set-output name=shouldc::false"
else
echo "The comment content contains the specified text. Continuing with further actions."
echo "::set-output name=shouldc::true"
fi
get-head-sha:
name: Get Pull Request Head SHA
needs: checkif
if: ${{ needs.checkif.outputs.shouldc == 'true' }}
runs-on: ubuntu-latest
outputs:
psha: ${{ steps.getsha.outputs.psha }}
env:
slink: ${{ github.event.issue.pull_request.url }}
steps:
- name: Get SHA
id: getsha
run: |
json_data=$(curl -s "$slink")
sha=$(echo "$json_data" | jq -r '.head.ref')
echo "psha=$sha" >> $GITHUB_OUTPUT
call-check-workflow:
name: Call Check Overflow
needs: get-head-sha
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Call
uses: benc-uk/[email protected]
with:
workflow: status-check.yml
ref: ${{ needs.get-head-sha.outputs.psha }}
inputs: '{ "psha": "${{ needs.get-head-sha.outputs.psha }}"}'
10 changes: 10 additions & 0 deletions DarockBili Watch App/DarockBiliApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
//
// Created by WindowsMEMZ on 2023/6/30.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the MeowBili open source project
//
// Copyright (c) 2023 Darock Studio and the MeowBili project authors
// Licensed under GNU General Public License v3
//
// See https://darock.top/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//

import Darwin
import SwiftUI
Expand Down
10 changes: 10 additions & 0 deletions DarockBili Watch App/Errors/ErrorGetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
//
// Created by WindowsMEMZ on 2023/7/4.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the MeowBili open source project
//
// Copyright (c) 2023 Darock Studio and the MeowBili project authors
// Licensed under GNU General Public License v3
//
// See https://darock.top/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//

import SwiftUI
import DarockKit
Expand Down
10 changes: 10 additions & 0 deletions DarockBili Watch App/Errors/FeedbackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
//
// Created by WindowsMEMZ on 2023/7/5.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the MeowBili open source project
//
// Copyright (c) 2023 Darock Studio and the MeowBili project authors
// Licensed under GNU General Public License v3
//
// See https://darock.top/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//

import SwiftUI
import DarockKit
Expand Down
10 changes: 10 additions & 0 deletions DarockBili Watch App/Errors/MemoryWarningView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
//
// Created by WindowsMEMZ on 2023/7/24.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the MeowBili open source project
//
// Copyright (c) 2023 Darock Studio and the MeowBili project authors
// Licensed under GNU General Public License v3
//
// See https://darock.top/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//

import SwiftUI

Expand Down
10 changes: 10 additions & 0 deletions DarockBili Watch App/Errors/SignalErrorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
//
// Created by WindowsMEMZ on 2023/7/14.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the MeowBili open source project
//
// Copyright (c) 2023 Darock Studio and the MeowBili project authors
// Licensed under GNU General Public License v3
//
// See https://darock.top/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//

import SwiftUI
import DarockKit
Expand Down
10 changes: 10 additions & 0 deletions DarockBili Watch App/Extension/AppFileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
//
// Created by WindowsMEMZ on 2023/7/4.
//
//===----------------------------------------------------------------------===//
//
// This source file is part of the MeowBili open source project
//
// Copyright (c) 2023 Darock Studio and the MeowBili project authors
// Licensed under GNU General Public License v3
//
// See https://darock.top/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//

import Foundation

Expand Down
Loading