-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (130 loc) · 3.98 KB
/
Copy pathrelease.yml
File metadata and controls
138 lines (130 loc) · 3.98 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Bygg og deploy
on:
workflow_dispatch:
inputs:
cluster:
description: Cluster
required: true
default: dev-gcp
type: choice
options:
- dev-gcp
- prod-gcp
push:
branches: [ main ]
paths-ignore:
- '.github/**'
- '*.md'
- 'CODEOWNERS'
jobs:
gradle:
permissions:
contents: write
actions: read
checks: write
id-token: write
uses: navikt/aap-workflows/.github/workflows/gradle-build.yml@main
secrets: inherit
publiser-kontrakt:
needs: gradle
concurrency: kontrakt
permissions:
contents: write
packages: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
# Ha denne tidlig, så action kan skippe raskt om ingen endringer.
- uses: paulhatch/semantic-version@9f72830310d5ed81233b641ee59253644cd8a8fc # v6.0.2
id: tag
with:
change_path: "kontrakt/"
bump_each_commit: true
tag_prefix: ""
bump_each_commit_patch_pattern: ''
major_pattern: "(MAJOR)" # If major bump, include this in commit message
- uses: actions/setup-java@ad2b38190b15e4d6bdf0c97fb4fca8412226d287 # v5.3.0
if: ${{ steps.tag.outputs.changed == 'true' }}
with:
java-version: 21
distribution: 'temurin'
- uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
with:
gradle-version: wrapper
- id: notes
if: ${{ steps.tag.outputs.changed == 'true' }}
run: |
randomDelimiter=${RANDOM}
text=$(git --no-pager log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")
echo 'CHANGELOG<<$randomDelimiter' >> $GITHUB_OUTPUT
echo $text >> $GITHUB_OUTPUT
echo '$randomDelimiter' >> $GITHUB_OUTPUT
- uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
if: ${{ steps.tag.outputs.changed == 'true' }}
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.version }}
name: ${{ steps.tag.outputs.version }}
body: |
Endringer siden sist:
${{ steps.notes.outputs.CHANGELOG }}
- if: ${{ steps.tag.outputs.changed == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew -Pversion=${{ steps.tag.outputs.version }} publish
topic-dev:
permissions:
contents: read
id-token: write
needs: gradle
concurrency:
group: deploy-topic-dev
uses: navikt/aap-workflows/.github/workflows/deploy.yml@main
secrets: inherit
with:
cluster: dev-gcp
manifest: .nais/topic-dev.yaml
dev:
permissions:
contents: read
id-token: write
needs: [ gradle, topic-dev ]
concurrency:
group: deploy-dev
uses: navikt/aap-workflows/.github/workflows/deploy.yml@main
secrets: inherit
with:
cluster: dev-gcp
manifest: .nais/app-dev.yml
topic-prod:
if: ${{ github.ref == 'refs/heads/main' || github.event.inputs.cluster == 'prod-gcp' }}
permissions:
contents: read
id-token: write
needs: [ publiser-kontrakt, dev ]
concurrency:
group: deploy-topic-prod
uses: navikt/aap-workflows/.github/workflows/deploy.yml@main
secrets: inherit
with:
cluster: prod-gcp
manifest: .nais/topic-prod.yaml
prod:
if: ${{ github.ref == 'refs/heads/main' || github.event.inputs.cluster == 'prod-gcp' }}
permissions:
contents: read
id-token: write
needs: [ publiser-kontrakt, dev, topic-prod ]
concurrency:
group: deploy-prod
uses: navikt/aap-workflows/.github/workflows/deploy.yml@main
secrets: inherit
with:
cluster: prod-gcp
manifest: .nais/app-prod.yml