-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (54 loc) · 1.93 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
name: Release MiSim
on:
push:
branches: [ master ]
jobs:
Prepare-and-Release:
if: !contains(github.event.head_commit.message, '[maven-release-plugin]')
name: Prepare and Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Configure Git
run: |
git config --global committer.email "[email protected]"
git config --global committer.name "GitHub Release Workflow"
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global author.name "${GITHUB_ACTOR}"
- name: Get Maven version
run: |
export MAVEN_VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed "s/-SNAPSHOT$//" )
echo "Retreived Maven Version: $MAVEN_VERSION"
echo "MAVEN_VERSION=$MAVEN_VERSION" >> $GITHUB_ENV
- name: Prepare & Release Maven Artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn -B release:prepare release:perform -DpushChanges=false -DlocalCheckout=true -Darguments="-DskipTests"
git clean -f
- name: Push to master
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.PUBLISHER_TOKEN }}
branch: master
tags: true
force: true
acceptable_conclusions: "success,skipped"
- name: Merge into develop
run: |
git fetch --all
git checkout develop
git merge master
- name: Push to develop
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.PUBLISHER_TOKEN }}
branch: develop
acceptable_conclusions: "success,skipped"