From e5c5d94c22d43260b29c7c455b7ea343bdae896d Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 16 Oct 2024 20:16:25 +0200 Subject: [PATCH] chore: just use github actions instead of selfhosted ones, I give up :( --- .gitea/workflows/cargo.yaml | 46 ---------------------- .github/dependabot.yaml | 7 ++++ .github/workflows/cargo.yaml | 10 ++++- {.gitea => .github}/workflows/release.yaml | 24 ++++------- 4 files changed, 22 insertions(+), 65 deletions(-) delete mode 100644 .gitea/workflows/cargo.yaml create mode 100644 .github/dependabot.yaml rename {.gitea => .github}/workflows/release.yaml (59%) diff --git a/.gitea/workflows/cargo.yaml b/.gitea/workflows/cargo.yaml deleted file mode 100644 index b755c81..0000000 --- a/.gitea/workflows/cargo.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: cargo devel CI -on: - push: - branches: - - '**' - # - '!master' - -jobs: - format: - name: cargo CI - permissions: - # Give the default GITHUB_TOKEN write permission to commit and push the - # added or changed files to the repository. - contents: write - steps: - - name: get repo - uses: actions/checkout@v4 - - name: install rust - uses: https://github.com/dtolnay/rust-toolchain@stable - - name: install additional rust things - run: | - rustup component add rustfmt - rustup component add clippy - - name: config custom registry - run: | - mkdir -p ~/.cargo/ - echo "" > ~/.cargo/config.toml - echo "[registry]" >> ~/.cargo/config.toml - echo 'cscherr = "cscherr"' >> ~/.cargo/config.toml - echo '[registries.cscherr]' >> ~/.cargo/config.toml - echo 'index = "https://git.cscherr.de/PlexSheep/_cargo-index.git"' >> ~/.cargo/config.toml - cat ~/.cargo/config.toml - - name: cargo clippy check - run: cargo clippy --all-features --all-targets --workspace - - name: cargo clippy fix - run: cargo clippy --fix --all-features --all-targets --workspace - - name: cargo fmt - run: cargo fmt --all - - name: cargo test - run: cargo test --all-features --all-targets --workspace - - name: commit back to repository - uses: https://github.com/stefanzweifel/git-auto-commit-action@v5 - with: - # Optional. Commit message for the created commit. - # Defaults to "Apply automatic changes" - commit_message: automatic cargo CI changes diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..7ee8cf8 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + # Check for updates every Monday + schedule: + interval: "weekly" diff --git a/.github/workflows/cargo.yaml b/.github/workflows/cargo.yaml index 29abfde..404d638 100644 --- a/.github/workflows/cargo.yaml +++ b/.github/workflows/cargo.yaml @@ -1,10 +1,16 @@ -name: cargo devel CI +name: Rust CI on: + pull_request: + branches: + - '**' push: branches: - '**' # - '!master' +env: + CARGO_TERM_COLOR: always + jobs: CI: runs-on: ubuntu-latest @@ -44,4 +50,4 @@ jobs: with: # Optional. Commit message for the created commit. # Defaults to "Apply automatic changes" - commit_message: automatic cargo CI changes + commit_message: "ci: automatic Rust CI changes" diff --git a/.gitea/workflows/release.yaml b/.github/workflows/release.yaml similarity index 59% rename from .gitea/workflows/release.yaml rename to .github/workflows/release.yaml index daee9b6..3a8f3fd 100644 --- a/.gitea/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,30 +7,25 @@ permissions: on: push: branches: - - master + - main jobs: # Release unpublished packages. release-plz-release: name: Release-plz release - # runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Rust toolchain - uses: https://github.com/dtolnay/rust-toolchain@stable - # - name: Manually Install binaries - # uses: https://github.com/taiki-e/install-action@v2 - # with: - # tool: cargo-semver-checks@0.35, release-plz # hack + uses: dtolnay/rust-toolchain@stable - name: Run release-plz - uses: https://github.com/MarcoIeni/release-plz-action@v0.5.79 + uses: MarcoIeni/release-plz-action@v0.5 with: command: release - backend: gitea env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} @@ -38,7 +33,7 @@ jobs: # Create a PR with the new versions and changelog, preparing the next release. release-plz-pr: name: Release-plz PR - # runs-on: ubuntu-latest + runs-on: ubuntu-latest concurrency: group: release-plz-${{ github.ref }} cancel-in-progress: false @@ -48,16 +43,11 @@ jobs: with: fetch-depth: 0 - name: Install Rust toolchain - uses: https://github.com/dtolnay/rust-toolchain@stable - # - name: Manually Install binaries - # uses: https://github.com/taiki-e/install-action@v2 - # with: - # tool: cargo-semver-checks@0.35, release-plz@0.3.102 # hack + uses: dtolnay/rust-toolchain@stable - name: Run release-plz - uses: https://github.com/MarcoIeni/release-plz-action@v0.5.79 + uses: MarcoIeni/release-plz-action@v0.5 with: command: release-pr - backend: gitea env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}