Skip to content
Merged
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
49 changes: 3 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@ name: CI/CD Pipeline
on:
push:
branches:
- '*'
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- '*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
- '**'
tags-ignore:
- '**'

jobs:
build:
Expand Down Expand Up @@ -67,39 +60,3 @@ jobs:

- name: Run Integration Tests
run: cargo test --test integration_tests --verbose -- --test-threads=1

docker:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: read
packages: write

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

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

- name: Extract metadata
id: meta
run: |
VERSION=${GITHUB_REF#refs/tags/}
REPO_LC=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "repo=${REPO_LC}" >> $GITHUB_OUTPUT

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ steps.meta.outputs.repo }}:latest
${{ env.REGISTRY }}/${{ steps.meta.outputs.repo }}:${{ steps.meta.outputs.version }}
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

permissions:
contents: write
packages: write

jobs:
publish-crates:
Expand Down Expand Up @@ -71,6 +72,8 @@ jobs:
fi

- name: Build binaries
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
run: cargo build --release --target ${{ matrix.target }}

- name: Package binaries (tar.gz)
Expand All @@ -95,3 +98,33 @@ jobs:
*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Extract metadata
id: meta
run: |
VERSION=${GITHUB_REF#refs/tags/}
REPO_LC=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "repo=${REPO_LC}" >> $GITHUB_OUTPUT

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/${{ steps.meta.outputs.repo }}:latest
ghcr.io/${{ steps.meta.outputs.repo }}:${{ steps.meta.outputs.version }}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "RustMock"
version = "0.3.1"
version = "0.3.2"
edition = "2021"
authors = ["Arthur Kowalsky <arthurkowalsky@users.noreply.github.com>"]
description = "Lightning-fast, lightweight API mock server with OpenAPI support and beautiful React dashboard"
Expand Down