Skip to content

Commit 1a06a07

Browse files
committed
Fetch the desired version from github. Release the correct version with version name
Signed-off-by: Knut-Erik Johnsen <[email protected]>
1 parent 9175c8f commit 1a06a07

File tree

5 files changed

+143
-20
lines changed

5 files changed

+143
-20
lines changed

.github/workflows/maven-release-provider-model.yaml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,28 @@ jobs:
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}/src/main/resources/kubernetes"
39-
run : ./fetch.sh
39+
run : ./fetch.sh "${{ github.event.inputs.releaseversion }}"
4040
- name: List crds
4141
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}/src/main/resources/kubernetes"
4242
run : ls
43-
#- name: Set the revision property
44-
# run: mvn versions:set-property -Dproperty=revision "-DnewVersion=${{ github.event.inputs.releaseversion }}" -DgenerateBackupPoms=false
45-
#- name: Build with Maven
46-
# run: mvn -B deploy --file pom.xml -Pdeploy
47-
# env:
48-
# MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
49-
# MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
50-
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
51-
# MAVEN_OPTS: "-Xmx2048m"
52-
#- name: Create release
53-
# env:
54-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
# tag: "${{ github.event.inputs.releaseversion }}"
56-
# run: |
57-
# gh release create "$tag" \
58-
# --repo="$GITHUB_REPOSITORY" \
59-
# --title="v${tag#v}" \
60-
# --generate-notes \
61-
# --target "$GITHUB_SHA"
43+
- name: Set the revision property
44+
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}"
45+
run: mvn versions:set-property -Dproperty=modelrevision "-DnewVersion=${{ github.event.inputs.releaseversion }}" -DgenerateBackupPoms=false
46+
- name: Build with Maven
47+
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}"
48+
run: mvn -B deploy --file pom.xml -Pdeploy
49+
env:
50+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
51+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
52+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
53+
MAVEN_OPTS: "-Xmx2048m"
54+
- name: Create release
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
tag: "${{ github.event.inputs.releaseversion }}"
58+
provider: "${{ github.event.inputs.provider }}"
59+
run: |
60+
gh release create "$provider-$tag" \
61+
--repo="$GITHUB_REPOSITORY" \
62+
--title="$provider--v${tag#v}" \
63+
--target "$GITHUB_SHA"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<!-- PROJECT -->
6+
<parent>
7+
<groupId>io.crossplane.providers</groupId>
8+
<artifactId>crossplane-providers-parent</artifactId>
9+
<version>1.17.0-alpha</version>
10+
</parent>
11+
12+
<artifactId>crossplane-provider-upjet-azure-model</artifactId>
13+
<description>Crossplane models for the Azure upjet based provider</description>
14+
15+
16+
<version>${modelrevision}</version>
17+
<properties>
18+
<modelrevision>1.0.0-SNAPSHOT</modelrevision>
19+
</properties>
20+
21+
<!-- DEPENDENCIES -->
22+
<dependencies>
23+
<dependency>
24+
<groupId>io.fabric8</groupId>
25+
<artifactId>kubernetes-client</artifactId>
26+
</dependency>
27+
<dependency>
28+
<groupId>io.fabric8</groupId>
29+
<artifactId>generator-annotations</artifactId>
30+
</dependency>
31+
</dependencies>
32+
<!-- BUILD -->
33+
<build>
34+
<!-- PLUGINS -->
35+
<plugins>
36+
<plugin>
37+
<groupId>io.fabric8</groupId>
38+
<artifactId>java-generator-maven-plugin</artifactId>
39+
<version>${kubernetes-client.version}</version>
40+
<executions>
41+
<execution>
42+
<goals>
43+
<goal>generate</goal>
44+
</goals>
45+
</execution>
46+
</executions>
47+
<configuration>
48+
<source>src/main/resources/kubernetes</source>
49+
</configuration>
50+
</plugin>
51+
</plugins>
52+
</build>
53+
54+
</project>

provider-models/crossplane-provider-upjet-azure/src/main/resources/kubernetes/fetch.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
release="v1.7.0"
44

5+
if [ $# -eq 1 ]
6+
then
7+
release="v$1"
8+
fi
9+
10+
echo "Fetching release: ${release}"
11+
512
crds=$(gh api --jq '.[].name' "/repos/crossplane-contrib/provider-upjet-azure/contents/package/crds/?ref=${release}")
613

714

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<!-- PROJECT -->
6+
<parent>
7+
<groupId>io.crossplane.providers</groupId>
8+
<artifactId>crossplane-providers-parent</artifactId>
9+
<version>1.17.0-alpha</version>
10+
</parent>
11+
12+
<artifactId>crossplane-provider-upjet-azuread-model</artifactId>
13+
<description>Crossplane models for the Azure AD upjet based provider</description>
14+
15+
<version>${modelrevision}</version>
16+
<properties>
17+
<modelrevision>1.0.0-SNAPSHOT</modelrevision>
18+
</properties>
19+
20+
<!-- DEPENDENCIES -->
21+
<dependencies>
22+
<dependency>
23+
<groupId>io.fabric8</groupId>
24+
<artifactId>kubernetes-client</artifactId>
25+
</dependency>
26+
<dependency>
27+
<groupId>io.fabric8</groupId>
28+
<artifactId>generator-annotations</artifactId>
29+
</dependency>
30+
</dependencies>
31+
<!-- BUILD -->
32+
<build>
33+
<!-- PLUGINS -->
34+
<plugins>
35+
<plugin>
36+
<groupId>io.fabric8</groupId>
37+
<artifactId>java-generator-maven-plugin</artifactId>
38+
<version>${kubernetes-client.version}</version>
39+
<executions>
40+
<execution>
41+
<goals>
42+
<goal>generate</goal>
43+
</goals>
44+
</execution>
45+
</executions>
46+
<configuration>
47+
<source>src/main/resources/kubernetes</source>
48+
</configuration>
49+
</plugin>
50+
</plugins>
51+
</build>
52+
53+
</project>

provider-models/crossplane-provider-upjet-azuread/src/main/resources/kubernetes/fetch.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
release="v1.5.0"
44

5+
if [ $# -eq 1 ]
6+
then
7+
release="v$1"
8+
fi
9+
10+
echo "Fetching release: ${release}"
11+
512
crds=$(gh api --jq '.[].name' "/repos/crossplane-contrib/provider-upjet-azuread/contents/package/crds/?ref=${release}")
613

714

0 commit comments

Comments
 (0)