-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.62 KB
/
release_mainline.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
# ******************************************************************************************************************
#
# Dette er en auto-generert fil; endringer gjøres i templates/.github/workflows/release_mainline.yml
# Kjør deretter ' make generate-files' for oppdatering av workflow hos prosjekter
#
# ******************************************************************************************************************
name: Release new version
on:
push:
branches:
- main
jobs:
release:
permissions:
packages: "write"
id-token: "write"
contents: "write"
runs-on: ubuntu-latest
steps:
- name: 'Pull repo'
uses: actions/checkout@v2
- name: 'Sett opp bruker i git'
run: git config user.email "${{ github.actor }}@users.noreply.github.com" && git config user.name "Github Actions"
- name: 'Hent versjonsnummer for release fra gradle.properties'
run: echo "VERSION=$(grep -v '^#' gradle.properties | grep 'version=' | cut -d '=' -f2 | xargs)" >> $GITHUB_ENV
- name: 'Java'
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: 'Bygg og oppdater versjon'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build release --stacktrace -Prelease.useAutomaticVersion=true
- name: 'Sjekk ut release'
uses: actions/checkout@v3
with:
ref: "release-${{ env.VERSION }}"
- name: 'Publiser release som maven-pakke'
run: ./gradlew publish --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}