diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 3604dc4..5b35aa7 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -1,11 +1,9 @@ name: Build Docker Image on: - push: - branches: [ "main" ] - tags: [ 'v*.*.*' ] - pull_request: - branches: [ "main" ] + release: + # Run this workflow only when a release is published + types: [published] env: REGISTRY: ghcr.io diff --git a/.github/workflows/build-electron.yml b/.github/workflows/build-electron.yml index b157561..8dd9d3c 100644 --- a/.github/workflows/build-electron.yml +++ b/.github/workflows/build-electron.yml @@ -1,11 +1,9 @@ name: Build Standalone App (Electron) on: - push: - branches: [ "main" ] - tags: [ 'v*.*.*' ] - pull_request: - branches: [ "main" ] + release: + # Run this workflow only when a release is published + types: [published] jobs: build: diff --git a/.github/workflows/build-pyinstaller.yml b/.github/workflows/build-pyinstaller.yml index 6e5cae2..7097e97 100644 --- a/.github/workflows/build-pyinstaller.yml +++ b/.github/workflows/build-pyinstaller.yml @@ -1,11 +1,9 @@ name: Build Portable Executable (PyInstaller) on: - push: - branches: [ "main" ] - tags: [ 'v*.*.*' ] - pull_request: - branches: [ "main" ] + release: + # Run this workflow only when a release is published + types: [published] jobs: build: diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..2db33bf --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,42 @@ +name: Create Release (manual) + +on: + workflow_dispatch: + branches: [ "main" ] + inputs: + version: + description: 'New release version (tag), e.g. v1.2.3' + required: true + type: string + body: + description: 'Release notes / body' + required: false + type: string + +permissions: + contents: write + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Ensure workflow is running on `main` + run: | + if [ "${GITHUB_REF#refs/heads/}" != "main" ]; then + echo "This workflow can only be run on the main branch."; + exit 1; + fi + + - name: Create GitHub Release + uses: actions/create-release@v1 + with: + tag_name: ${{ github.event.inputs.version || github.event.inputs.version }} + release_name: ${{ github.event.inputs.version || github.event.inputs.version }} + body: ${{ github.event.inputs.body || '' }} + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}