From 3ef32f30b92a127a230a9742fd251335a03f308c Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Sat, 6 Jul 2024 19:27:14 -0500 Subject: [PATCH] chore: Switch to Gitea Actions. --- .drone.yml | 42 ------------------------------------ .gitea/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ .gitea/workflows/test.yml | 39 +++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 42 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/release.yml create mode 100644 .gitea/workflows/test.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index bc0ec0c..0000000 --- a/.drone.yml +++ /dev/null @@ -1,42 +0,0 @@ -kind: pipeline -type: docker -name: default - -steps: - - name: test - image: rust - pull: always - commands: - - rustup component add clippy rustfmt - - apt-get update -qq - - apt-get install -qqy llvm-dev libclang-dev clang libspeechd-dev pkg-config libx11-dev libasound2-dev libudev-dev libxcb-xfixes0-dev libwayland-dev libxkbcommon-dev libvulkan-dev libpulse-dev - - cargo fmt --check - - cargo test --no-default-features --features=speech_dispatcher_0_10 - - cargo clippy --no-default-features --features=speech_dispatcher_0_10 - - name: release - image: rust - pull: always - commands: - - cargo publish --no-verify - when: - ref: - - refs/tags/v* - environment: - CARGO_REGISTRY_TOKEN: - from_secret: cargo_registry_token - - name: discord notification - image: appleboy/drone-discord - when: - status: [success, failure] - settings: - webhook_id: - from_secret: discord_webhook_id - webhook_token: - from_secret: discord_webhook_token - tts: true - message: > - {{#success build.status}} - {{repo.name}} build {{build.number}} succeeded: <{{build.link}}> - {{else}} - {{repo.name}} build {{build.number}} failed: <{{build.link}}> - {{/success}} diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..8daedbc --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy + - name: install Linux build dependencies + run: sudo apt-get update; sudo apt-get install -y + --no-install-recommends libasound2-dev libudev-dev libwayland-dev + libclang-dev libspeechd-dev + if: runner.os == 'linux' + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 + - ame: Publish + run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..712fd94 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,39 @@ +name: Test + +on: + pull_request: + push: + +jobs: + test: + strategy: + matrix: + # os: [windows-latest, ubuntu-latest, macos-latest] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy + - name: install Linux build dependencies + run: sudo apt-get update; sudo apt-get install -y + --no-install-recommends libasound2-dev libudev-dev libwayland-dev + libclang-dev libspeechd-dev + if: runner.os == 'linux' + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1