Skip to content

Commit

Permalink
fix(ci): set version before tests, publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Aug 12, 2024
1 parent 0ff2517 commit 1ccfae3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
needs: [ Secrets-Presence, Determine-Version ]
uses: ./.github/workflows/verify.yaml
secrets: inherit
with:
version: ${{ needs.Determine-Version.outputs.VERSION }}

Publish-Artefacts:
runs-on: ubuntu-latest
Expand All @@ -69,6 +71,13 @@ jobs:
with:
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}

- name: Set correct version
env:
VERSION: ${{ needs.Determine-Version.outputs.VERSION }}
run: |
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
grep -rlz "$existingVersion" . --exclude=\*.{sh,bin} | xargs sed -i "s/$existingVersion/$VERSION/g"
- name: "Publish To OSSRH/MavenCentral"
if: |
needs.Secrets-Presence.outputs.HAS_OSSRH
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-tech-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ jobs:
Bump-Version:
name: 'Update release version'
# cannot use the workflow-level env yet as it does not yet exist, must take output from previous job
if: ${{ !endsWith( needs.Prepare-Release.outputs.edc-version, '-SNAPSHOT') }}
# only bump the version for releases, no snapshots, no bugfixes/patches
if: ${{ endsWith( needs.Prepare-Release.outputs.edc-version, '.0') }}
needs: [ Prepare-Release, Github-Release ]
runs-on: ubuntu-latest
steps:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ name: Run Tests

on:
workflow_call:
inputs:
version:
required: false
type: string
description: optional version of upstream EDC components to use
workflow_dispatch:
inputs:
version:
required: false
type: string
description: optional version of upstream EDC components to use
push:
pull_request:
branches: [ main ]
Expand All @@ -12,6 +22,9 @@ on:
- 'CODEOWNERS'
- 'LICENSE'

env:
VERSION: ${{ github.event.inputs.version || inputs.version }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -23,6 +36,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Set upstream EDC version"
run: |
# update EDC dependencies in the version catalog
if [ ! -z ${{ env.VERSION }} ]; then
echo "set EDC version to ${{ env.VERSION }}"
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
sed -i "s/$existingVersion/${{ env.VERSION }}/g" gradle/libs.versions.toml
# some debug print
head -20 gradle/libs.versions.toml
fi
- name: Run Checkstyle
run: ./gradlew checkstyleMain checkstyleTest checkstyleTestFixtures
Expand All @@ -34,6 +58,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Set upstream EDC version"
run: |
# update EDC dependencies in the version catalog
if [ ! -z ${{ env.VERSION }} ]; then
echo "set EDC version to ${{ env.VERSION }}"
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
sed -i "s/$existingVersion/${{ env.VERSION }}/g" gradle/libs.versions.toml
# some debug print
head -20 gradle/libs.versions.toml
fi
- name: Run unit tests
uses: eclipse-edc/.github/.github/actions/run-tests@main
Expand All @@ -47,6 +82,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/setup-build@main
- name: "Set upstream EDC version"
run: |
# update EDC dependencies in the version catalog
if [ ! -z ${{ env.VERSION }} ]; then
echo "set EDC version to ${{ env.VERSION }}"
existingVersion=$(grep "version" gradle.properties | awk -F= '{print $2}')
sed -i "s/$existingVersion/${{ env.VERSION }}/g" gradle/libs.versions.toml
# some debug print
head -20 gradle/libs.versions.toml
fi
- name: End to End Integration Tests
uses: eclipse-edc/.github/.github/actions/run-tests@main
Expand Down

0 comments on commit 1ccfae3

Please sign in to comment.