-
Notifications
You must be signed in to change notification settings - Fork 3
139 lines (137 loc) · 4.83 KB
/
publish_to_maven_local.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
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
139
name: Test pulumi-kotlin generated code by publishing to Maven Local repository
on:
push:
branches:
- main
paths:
- '**.kt'
- '**.kts'
- '**.properties'
- '**.json'
- '**.xml'
- '**.yml'
- '**.yaml'
- '**.conf'
pull_request:
workflow_dispatch:
jobs:
publish-sdk:
name: Publish pulumi-kotlin SDK to Maven Local Repository
runs-on: ubuntu-latest
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Publish to Maven Local
run: ./gradlew sdk:publishPulumiKotlinSdkPublicationToMavenLocal -Dorg.gradle.daemon=false -q
publish:
name: Publish pulumi-${{ matrix.provider }}-kotlin (${{ matrix.major-version }}) to Maven Local Repository
runs-on: ${{ matrix.runs-on }}
if: ${{ startsWith(github.head_ref, 'prepare-release') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
strategy:
fail-fast: false
matrix:
include:
- provider: cloudflare
major-version: 5
runs-on: [ ubuntu-latest ]
- provider: slack
major-version: 0
runs-on: [ ubuntu-latest ]
- provider: github
major-version: 6
runs-on: [ ubuntu-latest ]
- provider: random
major-version: 4
runs-on: [ ubuntu-latest ]
- provider: gcp
major-version: 8
runs-on: [ self-hosted, active ]
- provider: google-native
major-version: 0
runs-on: [ self-hosted, active ]
- provider: aws
major-version: 6
runs-on: [ self-hosted, active ]
- provider: aws-native
major-version: 0
runs-on: [ self-hosted, active ]
- provider: azure
major-version: 6
runs-on: [ self-hosted, active ]
- provider: azure-native
major-version: 2
runs-on: [ self-hosted, active ]
- provider: kubernetes
major-version: 4
runs-on: [ self-hosted, active ]
- provider: nomad
major-version: 2
runs-on: [ ubuntu-latest ]
- provider: docker
major-version: 4
runs-on: [ ubuntu-latest ]
- provider: gitlab
major-version: 8
runs-on: [ ubuntu-latest ]
- provider: digitalocean
major-version: 4
runs-on: [ ubuntu-latest ]
- provider: alicloud
major-version: 3
runs-on: [ self-hosted, active ]
- provider: keycloak
major-version: 5
runs-on: [ ubuntu-latest ]
- provider: vault
major-version: 6
runs-on: [ ubuntu-latest ]
steps:
- name: Check out project sources
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
- name: Check if publication to Maven Local is necessary
id: check-for-release
shell: python
run: |
import os
import json
with open("src/main/resources/version-config.json") as version_config:
schemas = json.load(version_config)
versions = [
schema["kotlinVersion"] for schema in schemas
if schema["providerName"] == "${{ matrix.provider }}"
and schema["kotlinVersion"].split(".")[0] == "${{ matrix.major-version }}"
]
version = versions[0]
is_release = not version.endswith("-SNAPSHOT")
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
fh.write('is_release=' + str(is_release).lower())
- name: Publish to Maven Local
id: publish-to-maven-local
run: |
./gradlew publishPulumi${{ matrix.provider }}${{ matrix.major-version }}PublicationToMavenLocal \
-Dorg.gradle.jvmargs="-Xmx50g -Xss2048k" \
-Dorg.gradle.workers.max=1 \
-Dorg.gradle.daemon=false \
-Pkotlin.compiler.execution.strategy=in-process \
-q
if: |
(startsWith(github.head_ref, 'prepare-release') && steps.check-for-release.outputs.is_release == 'true') ||
(github.event_name == 'push' && steps.check-for-release.outputs.is_release == 'false') ||
github.event_name == 'workflow_dispatch'
- name: Upload buildSrc test report
if: ${{ failure() && steps.publish-to-maven-local.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: build-src-test-report
path: ./buildSrc/build/reports/tests/test/*
retention-days: 3