-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (50 loc) · 1.71 KB
/
releaseGithub.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
name: Release (Github Package Registry)
on:
push:
branches:
- 'master'
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Set release tag
run: |
COMMIT_COUNT=$(git rev-list --all --count)
TAG_NAME="$(echo $GITHUB_SHA | cut -c1-7)"
echo "RELEASE_TAG=${COMMIT_COUNT}.${TAG_NAME}" >> $GITHUB_ENV
- name: Set changelog
# (Escape newlines see https://github.com/actions/create-release/issues/25)
run: |
text="$(git --no-pager log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")"
text="${text//$'%'/%25}"
text="${text//$'\n'/%0A}"
text="${text//$'\r'/%0D}"
echo "CHANGELOG=$text" >> $GITHUB_ENV
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Deploy artifacts to github maven repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn -B versions:set -DnewVersion="$RELEASE_TAG"
mvn -B versions:commit
echo "Running release"
mvn -B --settings maven-settings.xml -pl -nav-organisasjonEndringer-v1-tjenestespesifikasjon deploy -Dmaven.wagon.http.pool=false
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: ${{ env.RELEASE_TAG }}
body: |
Changes in this Release
${{ env.CHANGELOG }}
draft: false
prerelease: false