-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (80 loc) · 2.91 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
name: Release
on:
push:
branches:
- master
paths:
- libs/**
jobs:
release:
name: Release libs
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Fetch git history"
run: git fetch --unshallow
- name: "Java"
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: "Setup"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo Release started by $GITHUB_ACTOR
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
- name: "Gradle"
uses: gradle/actions/setup-gradle@v3
- name: "Create version"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TIME=$(TZ="Europe/Oslo" date +%Y.%m.%d-%H.%M)
COMMIT=$(git rev-parse --short=12 HEAD)
export VERSION="$TIME-$COMMIT"
echo Set version=$VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: "Release avro-schema"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
run: ./gradlew :avro-schema:publish -PreleaseVersion=${{ env.VERSION }}
- name: "Release data-transfer-objects"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
run: ./gradlew :data-transfer-objects:publish -PreleaseVersion=${{ env.VERSION }}
- name: "Release reactive-core"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
run: ./gradlew :reactive-core:publish -PreleaseVersion=${{ env.VERSION }}
- name: "Release reactive-proxy"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
run: ./gradlew :reactive-proxy:publish -PreleaseVersion=${{ env.VERSION }}
- name: "Release reactive-security"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
run: ./gradlew :reactive-security:publish -PreleaseVersion=${{ env.VERSION }}
- name: "Release reactive-frontend"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
run: ./gradlew :reactive-frontend:publish -PreleaseVersion=${{ env.VERSION }}
- name: "Git tag og push"
env:
NAV_TOKEN: ${{ secrets.NAV_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag -a ${{ env.VERSION }} -m "Tag release version"
git push origin ${{ env.VERSION }}