Skip to content

Merge pull request #1 from UmutHasanoglu/claude/plan-app-improvements… #1

Merge pull request #1 from UmutHasanoglu/claude/plan-app-improvements…

Merge pull request #1 from UmutHasanoglu/claude/plan-app-improvements… #1

Workflow file for this run

# Release workflow for Library Management System
# Creates releases and publishes Docker images when tags are pushed
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: pytest -v
- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
body: |
## Library Management System v${{ steps.get_version.outputs.VERSION }}
### Installation
**Using pip:**
```bash
pip install -r requirements.txt
```
**Using Docker:**
```bash
docker pull ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.VERSION }}
docker run -p 8000:8000 ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.VERSION }}
```
See [CHANGELOG.md](CHANGELOG.md) for detailed changes.
docker-publish:
name: Publish Docker Image
runs-on: ubuntu-latest
needs: release
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in 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
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max