-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (45 loc) · 1.5 KB
/
build.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
name: Bygg og deploy
on:
push:
branches:
- master # Push events on master branch
jobs:
release-notes:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Release Drafter
uses: release-drafter/release-drafter@v6
id: drafter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: maven
- name: Hent tag
run: echo "TAG=$(date +%Y.%m.%d.%H%M%S)-$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
- name: Bygg og test
shell: bash
run: |
echo "Building $(echo $GITHUB_SHA | cut -c1-7)"
mvn deploy -Dmaven.wagon.http.pool=false -e --batch-mode --settings ./.m2/settings.xml
echo "Bygget og testet"
env:
GITHUB_USERNAME: x-access-token
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --settings ./.m2/settings.xml