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: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}/src/main/resources/kubernetes" 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 - name: List crds
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}/src/main/resources/kubernetes" working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}/src/main/resources/kubernetes"
run : ls run : ls
#- name: Set the revision property - name: Set the revision property
# run: mvn versions:set-property -Dproperty=revision "-DnewVersion=${{ github.event.inputs.releaseversion }}" -DgenerateBackupPoms=false working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}"
#- name: Build with Maven run: mvn versions:set-property -Dproperty=modelrevision "-DnewVersion=${{ github.event.inputs.releaseversion }}" -DgenerateBackupPoms=false
# run: mvn -B deploy --file pom.xml -Pdeploy - name: Build with Maven
# env: working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}"
# MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} run: mvn -B deploy --file pom.xml -Pdeploy
# MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} env:
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
# MAVEN_OPTS: "-Xmx2048m" MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
#- name: Create release MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
# env: MAVEN_OPTS: "-Xmx2048m"
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create release
# tag: "${{ github.event.inputs.releaseversion }}" env:
# run: | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# gh release create "$tag" \ tag: "${{ github.event.inputs.releaseversion }}"
# --repo="$GITHUB_REPOSITORY" \ provider: "${{ github.event.inputs.provider }}"
# --title="v${tag#v}" \ run: |
# --generate-notes \ gh release create "$provider-$tag" \
# --target "$GITHUB_SHA" --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" 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}") 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" 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}") crds=$(gh api --jq '.[].name' "/repos/crossplane-contrib/provider-upjet-azuread/contents/package/crds/?ref=${release}")