video2x/.github/workflows/release.yml
k4yt3x f5eb195d79
chore: reorganized packaging related files
Signed-off-by: k4yt3x <i@k4yt3x.com>
2024-10-30 00:00:00 +00:00

58 lines
1.4 KiB
YAML

name: Release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
setup:
if: github.event.base_ref == 'refs/heads/master'
name: Setup
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Get version
id: get_version
run: echo version=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT
container:
name: Build and upload container
needs:
- setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push the Docker image
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
dockerfile: packaging/docker/Dockerfile
image: video2x
tags: latest, ${{ needs.setup.outputs.version }}
create-release:
name: Create release
needs:
- setup
- container
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ needs.setup.outputs.version }}
name: ${{ needs.setup.outputs.version }}
draft: true
prerelease: false