Skip to content

Commit 2f1580c

Browse files
committed
chore(release): allow to manually push a release
1 parent 6f263b5 commit 2f1580c

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

Diff for: .github/workflows/release.yml

+24-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,22 @@ on:
44
push:
55
tags:
66
- 'v*' # Push events to matching v*, i.e. v1.0, v2.1.3
7+
workflow_dispatch:
8+
inputs:
9+
release_version:
10+
description: 'Release version'
11+
required: false
12+
type: string
13+
create_release:
14+
description: 'Create a GitHub release'
15+
required: false
16+
default: false
17+
type: boolean
718

819
jobs:
920
release:
1021
runs-on: ubuntu-22.04
22+
if: ${{ inputs.create_release }}
1123
steps:
1224
- uses: actions/checkout@v4
1325
- name: Install GraphViz
@@ -19,7 +31,12 @@ jobs:
1931
distribution: temurin
2032
- name: Build Java server
2133
run: make buildServer
22-
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
34+
- if: github.event_name == 'push'
35+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
36+
- if: github.event_name == 'workflow_dispatch'
37+
run: echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
38+
env:
39+
RELEASE_VERSION=${{ inputs.release_version }}
2340
- name: Generate checksums
2441
run: |
2542
cp kroki-server.jar kroki-standalone-server-${{ env.RELEASE_VERSION }}.jar
@@ -217,5 +234,10 @@ jobs:
217234
env:
218235
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
219236
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
220-
- name: Publish Docker images
237+
- if: github.event_name == 'workflow_dispatch'
238+
name: Publish Docker images ${{ inputs.release_version }}
239+
run: make publishDockerImages
240+
env:
241+
RELEASE_VERSION=${{ inputs.release_version }}
242+
- if: github.event_name == 'push'
221243
run: RELEASE_VERSION=${GITHUB_REF#refs/*/v*} make publishDockerImages

0 commit comments

Comments
 (0)