-
Notifications
You must be signed in to change notification settings - Fork 8
91 lines (89 loc) · 2.97 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
81
82
83
84
85
86
87
88
89
90
91
name: Release
on:
workflow_dispatch:
inputs:
branch:
description: "The branch to checkout when cutting the release."
required: true
default: "main"
increment-major:
description: "Should we increment the major version (true/false)"
required: true
default: "false"
increment-minor:
description: "Should we increment the minor version (true/false)"
required: true
default: "false"
jobs:
maven-release:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
token: ${{ secrets.HEROPHILUS_ACCESS_TOKEN }}
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: /tmp/.m2/repository
key: ${{ runner.os }}-maven
restore-keys: |
${{ runner.os }}-maven
- name: Java Maven release
uses: qcastel/[email protected]
env:
JAVA_HOME: /usr/lib/jvm/java-11-openjdk/
MAVEN_REPO_SERVER_ID: github
MAVEN_REPO_SERVER_USERNAME: idaas-bot
MAVEN_REPO_SERVER_PASSWORD: ${{ secrets.HEROPHILUS_ACCESS_TOKEN }}
with:
access-token: ${{ secrets.HEROPHILUS_ACCESS_TOKEN }}
release-branch-name: ${{ github.event.inputs.branch }}
version-major: ${{ github.event.inputs.increment-major }}
version-minor: ${{ github.event.inputs.increment-minor }}
git-release-bot-name: "idaas-bot"
maven-options: "-s /github/workspace/.github/workflows/settings.xml -Dmaven.repo.local=/tmp/.m2/repository"
maven-args: "-Dmaven.repo.local=/tmp/.m2/repository"
maven-repo-server-id: github
m2-home-folder: '/tmp/.m2/repository'
get-tag:
runs-on: ubuntu-latest
needs: maven-release
outputs:
git_tag: ${{ steps.tag.outputs.git_tag }}
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.HEROPHILUS_ACCESS_TOKEN }}
- name: Git Tag
id: tag
run: |
git pull
export GIT_TAG=`git describe --abbrev=0 --tags`
echo "TAG: $GIT_TAG"
echo ::set-output name=git_tag::$(echo ${GIT_TAG})
git-release:
runs-on: ubuntu-latest
needs: get-tag
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
ref: ${{ needs.get-tag.outputs.git_tag }}
token: ${{ secrets.HEROPHILUS_ACCESS_TOKEN }}
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: /tmp/.m2/repository
key: ${{ runner.os }}-maven
restore-keys: |
${{ runner.os }}-maven
- name: Package
run: mvn package -Dmaven.repo.local=/tmp/.m2/repository
- uses: ncipollo/release-action@v1
with:
artifacts: "iDaaS-KIC-Integration/RedHat/target/*.jar,iDaaS-KIC-Integration/Upstream/target/*.jar"
token: ${{ secrets.HEROPHILUS_ACCESS_TOKEN }}
tag: ${{ needs.get-tag.outputs.git_tag }}