mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "Release tag to create"
|
|
required: true
|
|
type: string
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
jobs:
|
|
helm:
|
|
name: Publish Helm Chart
|
|
uses: ./.github/workflows/helm.yml
|
|
with:
|
|
release-tag: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
|
|
secrets:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
HELM_OCI_NAMESPACE: ${{ secrets.HELM_OCI_NAMESPACE }}
|
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
DOCKERHUB_REPOSITORY: ${{ secrets.DOCKERHUB_REPOSITORY }}
|
|
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
release:
|
|
name: Create GitHub Release
|
|
needs: helm
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Create or update GitHub release
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
if gh release view "${RELEASE_TAG}" >/dev/null 2>&1; then
|
|
echo "Release ${RELEASE_TAG} already exists; leaving it unchanged."
|
|
exit 0
|
|
fi
|
|
|
|
target_sha="$(git rev-parse "${RELEASE_TAG}^{commit}")"
|
|
release_args=(
|
|
"${RELEASE_TAG}"
|
|
--target "${target_sha}"
|
|
--title "${RELEASE_TAG}"
|
|
--generate-notes
|
|
)
|
|
|
|
version="${RELEASE_TAG#v}"
|
|
if [[ "$version" == *-* ]]; then
|
|
release_args+=(--prerelease --latest=false)
|
|
fi
|
|
|
|
gh release create "${release_args[@]}"
|