Skip to content

Commit

Permalink
feat: Rewrite all actions and add release action (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
HttpRafa authored Jan 7, 2025
1 parent 0ba08fb commit e6d1678
Show file tree
Hide file tree
Showing 18 changed files with 293 additions and 471 deletions.
1 change: 1 addition & 0 deletions .config/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rustflags = "-Z wasi-exec-model=reactor"
File renamed without changes.
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build & Test

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo build
uses: actions/cache@v4
with:
path: |
target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Cache Gradle Dependencies
id: cache-gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/gradle-wrapper.jar') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: Install Protobuf Compiler
run: sudo apt update && sudo apt install protobuf-compiler -y

- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Build Projects
run: cargo build --all --all-features --verbose
env:
CURRENT_COMMIT: ${{ github.sha }}
CURRENT_BUILD: ${{ github.run_number }}

- name: Run Tests
run: cargo test --workspace --exclude pterodactyl --all-features --verbose

- name: Build & Test JVM Client
working-directory: clients/jvm
run: |
chmod +x gradlew
./gradlew build --no-daemon
env:
CURRENT_COMMIT: ${{ github.sha }}
CURRENT_BUILD: ${{ github.run_number }}
60 changes: 60 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Docker

on:
release:
types:
- published

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
name: Build & Push
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Docker Metadata
id: docker-meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == false }}
type=ref,event=tag
type=ref,event=branch
- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/riscv64
build-args: |
CURRENT_COMMIT=${{ github.sha }}
CURRENT_BUILD=${{ github.run_number }}
labels: ${{ steps.docker-meta.outputs.labels }}
tags: ${{ steps.docker-meta.outputs.tags }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Publish Docs
name: Docs

on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -10,7 +9,8 @@ on:
- mkdocs.yml

jobs:
build:
deploy:
name: Deploy Docs
runs-on: ubuntu-24.04
permissions:
contents: write
Expand All @@ -19,15 +19,13 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install MkDocs Material
run: |
pip install mkdocs-material
run: pip install mkdocs-material

- name: Publish Docs
run: |
mkdocs gh-deploy --force
- name: Deploy Docs
run: mkdocs gh-deploy --force
55 changes: 0 additions & 55 deletions .github/workflows/java_paper.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/publish_api.yml

This file was deleted.

Loading

0 comments on commit e6d1678

Please sign in to comment.