Release a new version of a provider model #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release a new version of a provider model | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseversion: | |
type: string | |
description: 'Version to release' | |
required: true | |
provider: | |
type: choice | |
description: 'Provider to release' | |
required: true | |
options: | |
- provider-upjet-azure | |
- provider-upjet-azuread | |
- provider-upjet-aws | |
- provider-upjet-gcp | |
- provider-upjet-github | |
- provider-terraform | |
- provider-kubernetes | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'oracle' | |
cache: maven | |
server-id: central | |
server-username: MAVEN_CENTRAL_USERNAME # env variable for username in deploy | |
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
- name: Fetch crds | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: "./provider-models/crossplane-${{ github.event.inputs.provider }}/src/main/resources/kubernetes" | |
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 | |
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" |