Fetch the desired version from github. Release the correct version with version name

Signed-off-by: Knut-Erik Johnsen <abstract@knut-erik.org>
This commit is contained in:
Knut-Erik Johnsen 2024-10-11 13:11:02 +02:00
parent 9175c8fffc
commit 1a06a07237
5 changed files with 143 additions and 20 deletions

View File

@ -36,26 +36,28 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}/src/main/resources/kubernetes"
run : ./fetch.sh
run : ./fetch.sh "${{ github.event.inputs.releaseversion }}"
- name: List crds
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}/src/main/resources/kubernetes"
run : ls
#- name: Set the revision property
# run: mvn versions:set-property -Dproperty=revision "-DnewVersion=${{ github.event.inputs.releaseversion }}" -DgenerateBackupPoms=false
#- name: Build with Maven
# run: mvn -B deploy --file pom.xml -Pdeploy
# env:
# MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
# MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
# MAVEN_OPTS: "-Xmx2048m"
#- name: Create release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# tag: "${{ github.event.inputs.releaseversion }}"
# run: |
# gh release create "$tag" \
# --repo="$GITHUB_REPOSITORY" \
# --title="v${tag#v}" \
# --generate-notes \
# --target "$GITHUB_SHA"
- name: Set the revision property
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}"
run: mvn versions:set-property -Dproperty=modelrevision "-DnewVersion=${{ github.event.inputs.releaseversion }}" -DgenerateBackupPoms=false
- name: Build with Maven
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}"
run: mvn -B deploy --file pom.xml -Pdeploy
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_OPTS: "-Xmx2048m"
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: "${{ github.event.inputs.releaseversion }}"
provider: "${{ github.event.inputs.provider }}"
run: |
gh release create "$provider-$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="$provider--v${tag#v}" \
--target "$GITHUB_SHA"

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- PROJECT -->
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.17.0-alpha</version>
</parent>
<artifactId>crossplane-provider-upjet-azure-model</artifactId>
<description>Crossplane models for the Azure upjet based provider</description>
<version>${modelrevision}</version>
<properties>
<modelrevision>1.0.0-SNAPSHOT</modelrevision>
</properties>
<!-- DEPENDENCIES -->
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>generator-annotations</artifactId>
</dependency>
</dependencies>
<!-- BUILD -->
<build>
<!-- PLUGINS -->
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>java-generator-maven-plugin</artifactId>
<version>${kubernetes-client.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<source>src/main/resources/kubernetes</source>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -2,6 +2,13 @@
release="v1.7.0"
if [ $# -eq 1 ]
then
release="v$1"
fi
echo "Fetching release: ${release}"
crds=$(gh api --jq '.[].name' "/repos/crossplane-contrib/provider-upjet-azure/contents/package/crds/?ref=${release}")

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- PROJECT -->
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.17.0-alpha</version>
</parent>
<artifactId>crossplane-provider-upjet-azuread-model</artifactId>
<description>Crossplane models for the Azure AD upjet based provider</description>
<version>${modelrevision}</version>
<properties>
<modelrevision>1.0.0-SNAPSHOT</modelrevision>
</properties>
<!-- DEPENDENCIES -->
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>generator-annotations</artifactId>
</dependency>
</dependencies>
<!-- BUILD -->
<build>
<!-- PLUGINS -->
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>java-generator-maven-plugin</artifactId>
<version>${kubernetes-client.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<source>src/main/resources/kubernetes</source>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -2,6 +2,13 @@
release="v1.5.0"
if [ $# -eq 1 ]
then
release="v$1"
fi
echo "Fetching release: ${release}"
crds=$(gh api --jq '.[].name' "/repos/crossplane-contrib/provider-upjet-azuread/contents/package/crds/?ref=${release}")