Skip to content

chore: refactor workflows and introduce dependabot #371

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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:
- '*'
62 changes: 57 additions & 5 deletions .github/workflows/release.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -29,7 +33,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

build-app:
needs: create-release
permissions:
contents: write
strategy:
Expand Down Expand Up @@ -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')
Expand All @@ -91,8 +97,54 @@ 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: ${{ github.ref_type != 'tag' && matrix.platform != 'windows-latest' && matrix.platform != 'macos-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 (macOS)
if: ${{ github.ref_type != 'tag' && matrix.platform == 'macos-latest'}}
run: |
mkdir artifacts
mv ${{ github.workspace }}/target/**/release/bundle/**/*.dmg artifacts

- name: Prepare artifacts (Windows)
if: ${{ github.ref_type != 'tag' && 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: BongonCat-${{ 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 }}
Expand All @@ -101,7 +153,7 @@ jobs:
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: ${{ github.ref_name }}
releaseName: BongoCat ${{ needs.create-release.outputs.APP_VERSION }}
releaseName: BongoCat ${{ github.ref_name }}
releaseBody: ''
releaseDraft: true
prerelease: false
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/sync-to-gitee.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Sync Github Repos To Gitee
name: Sync Github Repository To Gitee
on:
push:
branches:
Expand All @@ -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