diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..8ce58586 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,35 @@ +version: 2 +updates: + - package-ecosystem: github-actions + target-branch: master + directory: / + schedule: + interval: daily + groups: + actions-dependencies: + patterns: + - '*' + + - package-ecosystem: cargo + target-branch: master + directory: / + schedule: + interval: daily + allow: + - dependency-type: all + groups: + rust-dependencies: + patterns: + - '*' + + - package-ecosystem: npm + target-branch: master + directory: / + schedule: + interval: daily + allow: + - dependency-type: all + groups: + npm-dependencies: + patterns: + - '*' diff --git a/.github/workflows/release.yml b/.github/workflows/build.yml similarity index 58% rename from .github/workflows/release.yml rename to .github/workflows/build.yml index c1723005..f8e1ba35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,18 @@ -name: Release CI +name: Build BongoCat artifacts on: push: tags: - 'v*' + pull_request: + branches: [master] + workflow_call: workflow_dispatch: jobs: create-release: runs-on: ubuntu-latest + if: ${{ github.ref_type == 'tag' }} steps: - uses: actions/checkout@v4 with: @@ -29,7 +33,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} build-app: - needs: create-release permissions: contents: write strategy: @@ -66,7 +69,10 @@ jobs: version: latest - name: Install rust target - run: rustup target add ${{ matrix.target }} + run: | + rustup default stable + rustup update stable + rustup target add ${{ matrix.target }} - name: Install dependencies (ubuntu only) if: startsWith(matrix.platform, 'ubuntu') @@ -91,8 +97,48 @@ jobs: - name: Install app dependencies and build web run: pnpm install --frozen-lockfile - - name: Build the app + - name: Build BongoCat + id: build + uses: tauri-apps/tauri-action@v0 + if: ${{ github.ref_type != 'tag' }} + env: + CI: true + PLATFORM: ${{ matrix.platform }} + # Signature is exposed here to make sure it works in PR's + # https://github.com/tauri-apps/tauri-action/blob/dev/.github/workflows/test-action.yml#L165 + TAURI_SIGNING_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg== + with: + args: --target ${{ matrix.target }} + + - name: Prepare artifacts + if: matrix.platform != 'windows-latest' + run: | + mkdir artifacts + paths=$(echo '${{ steps.build.outputs.artifactPaths }}' | jq -c '.[]' | sed 's/"//g') + for fn in $paths; do + if [[ -f $fn ]]; then + mv $fn artifacts + fi + done + + - name: Prepare artifacts (Windows) + if: matrix.platform == 'windows-latest' + run: | + mkdir artifacts + mv ${{ github.workspace }}/target/**/release/bundle/**/*.exe artifacts + mv ${{ github.workspace }}/target/**/release/bundle/**/*.sig artifacts + + - name: Upload build artifacts + if: ${{ github.ref_type != 'tag' }} + uses: actions/upload-artifact@v4 + with: + name: BongoCat-${{ matrix.target }} + path: artifacts + compression-level: 9 + + - name: Build and Release BongoCat uses: tauri-apps/tauri-action@v0 + if: ${{ github.ref_type == 'tag' }} env: CI: false PLATFORM: ${{ matrix.platform }} diff --git a/.github/workflows/sync-to-gitee.yml b/.github/workflows/sync-to-gitee.yml index e2e81e29..f327d355 100644 --- a/.github/workflows/sync-to-gitee.yml +++ b/.github/workflows/sync-to-gitee.yml @@ -1,4 +1,4 @@ -name: Sync Github Repos To Gitee +name: Sync Github Repository To Gitee on: push: branches: @@ -8,12 +8,16 @@ jobs: repo-sync: runs-on: ubuntu-latest steps: - - name: Sync Github Repos To Gitee + - name: Sync Github Repository To Gitee uses: Yikun/hub-mirror-action@master + env: + GITEE_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }} + GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }} + if: ${{ env.GITEE_PRIVATE_KEY != '' && env.GITEE_TOKEN != '' }} with: src: github/ayangweb dst: gitee/ayangweb - dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} - dst_token: ${{ secrets.GITEE_TOKEN }} + dst_key: ${{ env.GITEE_PRIVATE_KEY }} + dst_token: ${{ env.GITEE_TOKEN }} static_list: BongoCat force_update: true