This repository has been archived by the owner on Jul 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (69 loc) · 2.43 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: 📦 Release
on:
push:
branches:
- main
- dev
jobs:
Publish:
env:
jdk: 16
maven_cmd: clean package
ref_main: "main"
ref_dev: "dev"
files: |
./target/jdavcspeaker-jar-with-dependencies.jar
runs-on: ubuntu-latest
steps:
- name: 👉 Release Version
id: version
uses: mathieudutour/[email protected]
with:
github_token: ${{ github.token }}
default_bump: "minor"
custom_release_rules: "breaking:major:💣 Breaking Changes,feat:minor:✨ Features,fix:patch:💣 Bug Fixes,docs:patch:📰 Docs,chore:patch:🎨 Chore,pref:patch:🎈 Performance improvements,refactor:patch:🧹 Refactoring,build:patch:🔍 Build,ci:patch:🔍 CI,revert:patch:⏪ Revert,style:patch:🧹 Style,test:patch:👀 Test"
- name: 📻 Setup JDK16
uses: actions/[email protected]
with:
distribution: "zulu"
java-version: ${{ env.jdk }}
- name: 📦 Checkout ${{ github.repository }}
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
token: ${{ github.token }}
- name: ⌛ Cache
uses: actions/cache@v2
with:
path: ~/.m2/caches
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: ✏ Insert Version
run: |
sed -r -i "1,/version/s#<version>(.+?)</version>#<version>${{ steps.version.outputs.new_version }}</version>#" pom.xml
git diff
- name: 📦 Package
env:
project_version: ${{ steps.version.outputs.new_version }}
run: |
mvn ${{ env.maven_cmd }}
- name: 🗃️ Publish Release (main)
env:
project_version: ${{ steps.version.outputs.new_version }}
if: github.ref_name == env.ref_main
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
tag_name: ${{ env.project_version }}
files: ${{ env.files }}
- name: 🗃️ Publish Release (dev)
env:
project_version: ${{ steps.version.outputs.new_version }}
if: github.ref_name == env.ref_dev
uses: softprops/action-gh-release@v1
with:
prerelease: true
generate_release_notes: true
tag_name: ${{ env.project_version }}
files: ${{ env.files }}