Skip to content

Commit

Permalink
better handling of the version file
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Sep 21, 2023
1 parent 19989ce commit 28e3e0a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/publish-java-cdk-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ env:
GITREF: ${{ github.event.inputs.gitref || github.ref }}
FORCE: "${{ github.event.inputs.force == null && true || github.event.inputs.force }}"
DRY_RUN: "${{ github.event.inputs.dry-run == null && true || github.event.inputs.dry-run }}"
CDK_VERSION_FILE_PATH: "./airbyte-cdk/java/airbyte-cdk/src/main/resources/version.properties"
# Uncomment and replace above when CDK 0.1.0 is released:
# CDK_VERSION_FILE_PATH: "./airbyte-cdk/java/airbyte-cdk/src/main/resources/version.properties"

jobs:
# We are using these runners because they are the same as the one for `publish-command.yml`
Expand Down Expand Up @@ -100,7 +103,11 @@ jobs:
- name: Read Target Java CDK version
id: read-target-java-cdk-version
run: |
cdk_version=$(cat ./airbyte-cdk/java/airbyte-cdk/core/src/main/resources/version.properties | tr -d '\n')
cdk_version=$(cat $CDK_VERSION_FILE_PATH | tr -d '\n')
if [[ -z "$cdk_version" ]]; then
echo "Failed to retrieve CDK version from $CDK_VERSION_FILE_PATH"
exit 1
fi
echo "CDK_VERSION=${cdk_version}" >> $GITHUB_ENV
- name: Check for already-published version (${{ env.CDK_VERSION }}, FORCE=${{ env.FORCE }})
if: ${{ !(env.FORCE == 'true') }}
Expand All @@ -119,12 +126,12 @@ jobs:
echo "Version ${VERSION} of ${ARTIFACT_ID} has not been published. Proceeding..."
fi
- name: Build Java CDK
run: ./gradlew --no-daemon :airbyte-cdk:java:java-cdk:build
run: ./gradlew --no-daemon :airbyte-cdk:java:airbyte-cdk:build
- name: Publish Java Modules to LocalMaven (Dry-Run)
run: ./gradlew --no-daemon :airbyte-cdk:java:java-cdk:publishToLocalMaven
run: ./gradlew --no-daemon :airbyte-cdk:java:airbyte-cdk:publishToLocalMaven
- name: Publish Java Modules to CloudRepo
if: ${{ env.DRY_RUN == 'false' }}
run: ./gradlew --no-daemon :airbyte-cdk:java:java-cdk:publish
run: ./gradlew --no-daemon :airbyte-cdk:java:airbyte-cdk:publish
env:
CLOUDREPO_USER: ${{ secrets.CLOUDREPO_USER }}
CLOUDREPO_PASSWORD: ${{ secrets.CLOUDREPO_PASSWORD }}
Expand Down

0 comments on commit 28e3e0a

Please sign in to comment.