refactor: migrate to woodpecker

This commit is contained in:
JasterV 2026-03-09 17:07:03 +01:00
commit 23af9fc8a0
8 changed files with 61 additions and 148 deletions

View file

@ -1,19 +0,0 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
time: "09:00"
groups:
grpc:
patterns:
- "tonic"
- "tonic-*"
- "prost"
- "prost-*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View file

@ -1,53 +0,0 @@
name: Release-plz
on:
push:
branches:
- main
jobs:
# Release unpublished packages.
release-plz-release:
name: Release-plz release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- &checkout
name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- &install-rust
name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_AUTH_KEY }}
# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
name: Release-plz PR
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- *checkout
- *install-rust
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_AUTH_KEY }}

View file

@ -1,35 +0,0 @@
name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: rustup default 1.92.0
- run: rustup component add clippy rustfmt
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # ratchet:Swatinem/rust-cache@v2
- uses: taiki-e/install-action@ae532dedd825648efd18d9c49c9a443d0398ca0a # ratchet:taiki-e/install-action@cargo-make
- name: Install protoc compiler
run: |
sudo apt update -y
sudo apt install -y protobuf-compiler
- run: cargo make ci
alls-green:
if: always()
runs-on: ubuntu-latest
needs:
- ci
steps:
- run: ${{ !contains(needs.*.result, 'failure') }}

View file

@ -1,39 +0,0 @@
name: Release Binaries
permissions:
contents: write
on:
release:
types: [published]
jobs:
upload-assets:
name: Upload assets for ${{ matrix.target }}
if: startsWith(github.event.release.tag_name, 'granc-v')
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux x86_64
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
# macOS x86_64 (Intel)
- target: x86_64-apple-darwin
os: macos-latest
# macOS ARM64 (Apple Silicon)
- target: aarch64-apple-darwin
os: macos-latest
# Windows x86_64
- target: x86_64-pc-windows-msvc
os: windows-latest
steps:
- uses: actions/checkout@v6
- name: Build and Upload
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: granc
target: ${{ matrix.target }}
token: ${{ secrets.GITHUB_TOKEN }}

23
.woodpecker/cd.yml Normal file
View file

@ -0,0 +1,23 @@
when:
event: push
branch: main
depends_on:
- ci
steps:
- name: Release unpublished
image: codeberg.org/jasterv/rust-magic-release:latest
pull: true
settings:
token:
from_secret: CODEBERG_TOKEN
crates_io_token:
from_secret: CRATES_IO_TOKEN
- name: Update PR
image: codeberg.org/jasterv/release-plz-update-pr:latest
pull: true
settings:
token:
from_secret: CODEBERG_TOKEN

11
.woodpecker/ci.yml Normal file
View file

@ -0,0 +1,11 @@
when:
- event: [push, pull_request]
branch: main
steps:
ci:
image: codeberg.org/jasterv/rust-ci:1.93
commands:
- apt update -y
- apt-get install -y protobuf-compiler
- cargo make ci

View file

@ -0,0 +1,25 @@
when:
event: tag
ref: refs/tags/granc-v*
steps:
build:
image: rust:latest
pull: true
commands:
- cargo build --release --target x86_64-unknown-linux-gnu
package:
image: alpine
commands:
- apk add --no-cache tar gzip
- tar -czf granc-x86_64-unknown-linux-gnu.tgz -C target/x86_64-unknown-linux-gnu/release granc
publish:
image: woodpeckerci/plugin-release
settings:
base_url: https://codeberg.org
files:
- granc-x86_64-unknown-linux-gnu.tgz
api_key:
from_secret: CODEBERG_TOKEN

View file

@ -5,9 +5,9 @@ resolver = "2"
[workspace.package]
authors = ["Victor Martínez Montané <jaster.victor@gmail.com>"]
edition = "2024"
homepage = "https://github.com/JasterV/granc"
homepage = "https://codeberg.org/JasterV/granc"
license = "MIT OR Apache-2.0"
repository = "https://github.com/JasterV/granc"
repository = "https://codeberg.org/JasterV/granc"
rust-version = "1.89"
[workspace.dependencies]