mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 02:35:14 +00:00
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version_type:
|
|
description: 'Type of version increment'
|
|
required: true
|
|
default: 'patch'
|
|
type: choice
|
|
options:
|
|
- major
|
|
- minor
|
|
- patch
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config user.name "GitHub Actions"
|
|
git config user.email "actions@github.com"
|
|
|
|
- name: Update Version
|
|
id: update_version
|
|
run: |
|
|
python scripts/bump_version.py ${{ github.event.inputs.version_type }}
|
|
NEW_VERSION=$(python -c "import version; print(f'{version.__version__}')")
|
|
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
|
|
- name: Commit and Tag
|
|
run: |
|
|
git add version.py
|
|
git commit -m "Release v${{ steps.update_version.outputs.new_version }}"
|
|
git tag -a "v${{ steps.update_version.outputs.new_version }}" -m "Release v${{ steps.update_version.outputs.new_version }}"
|
|
git push origin main --tags
|
|
|
|
- name: Build and Push Release Image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository_owner }}/dispatcharr:latest
|
|
ghcr.io/${{ github.repository_owner }}/dispatcharr:${{ steps.update_version.outputs.new_version }}
|
|
file: ./docker/Dockerfile
|
|
|
|
- name: Create GitHub Release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: v${{ steps.update_version.outputs.new_version }}
|
|
release_name: Release v${{ steps.update_version.outputs.new_version }}
|
|
draft: false
|
|
prerelease: false
|