Skip to content

Commit 9b961e5

Browse files
authored
Create Manual Release
Add manually triggered releases. For building branches other than develop manually.
1 parent 6b6d807 commit 9b961e5

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Publish Release
10+
11+
on:
12+
schedule:
13+
# At 0:00am each day on the default branch
14+
- cron: '0 0 * * *'
15+
workflow_dispatch:
16+
inputs:
17+
tag:
18+
description: 'Version tag'
19+
required: true
20+
type: string
21+
name:
22+
description: 'Release name'
23+
required: true
24+
type: string
25+
skip_tests:
26+
description: 'Skip tests'
27+
required: true
28+
default: false
29+
type: boolean
30+
31+
jobs:
32+
publish_release:
33+
runs-on: ubuntu-latest
34+
container: maven:3-eclipse-temurin-8
35+
steps:
36+
- uses: actions/checkout@v3
37+
38+
- name: Cache local Maven repository
39+
uses: actions/cache/restore@v3
40+
with:
41+
path: /root/.m2/repository
42+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
43+
restore-keys: |
44+
${{ runner.os }}-maven-
45+
46+
- name: Build and Test with Maven
47+
run: mvn -P '!add-dependencies-for-IDEA,full-build,include-front-end' -B package -DskipTests=${{ github.event_name == 'workflow_dispatch' && inputs.skip_tests || true }} --file flink-cyber/pom.xml
48+
49+
- name: Release
50+
uses: softprops/action-gh-release@v2
51+
if: ${{ github.event_name == 'workflow_dispatch' }}
52+
with:
53+
tag_name: ${{ inputs.tag }}
54+
name: ${{ inputs.name }}
55+
draft: true
56+
generate_release_notes: true
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
files: |
59+
flink-cyber/cyber-csd/target/cyber-csd--*
60+
flink-cyber/cyber-csd/target/CYBERSEC-*
61+
flink-cyber/cyber-parcel/target/CYBERSEC-*
62+
63+
- name: Get current date
64+
id: date
65+
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
66+
67+
- name: Publish artifact
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: cybersec-${{ github.event_name == 'workflow_dispatch' && 'release' || 'nightly' }}-${{ env.CURRENT_DATE }}
71+
path: |
72+
flink-cyber/cyber-csd/target/cyber-csd--*
73+
flink-cyber/cyber-csd/target/CYBERSEC-*
74+
flink-cyber/cyber-parcel/target/CYBERSEC-*

0 commit comments

Comments
 (0)