Skip to content

Commit a00a6cf

Browse files
committed
ci: use base/get-version action to check publishing
1 parent 8d421d7 commit a00a6cf

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

.github/workflows/build.yaml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@ on:
1515

1616
jobs:
1717

18+
check-publish:
19+
name: check publish
20+
runs-on: ubuntu-latest
21+
outputs:
22+
BUILD_VERSION: ${{ env.BUILD_VERSION }}
23+
BUILD_SNAPSHOT: ${{ env.BUILD_SNAPSHOT }}
24+
BUILD_PUBLISH: ${{ env.BUILD_PUBLISH }}
25+
26+
steps:
27+
- name: get version
28+
id: get-version
29+
uses: openapi-processor/openapi-processor-base/.github/actions/version@main
30+
with:
31+
version-file: 'gradle/libs.versions.toml'
32+
version-path: 'versions.processor'
33+
34+
- name: set version outputs
35+
shell: bash
36+
run: |
37+
echo BUILD_VERSION="${{steps.get-version.outputs.version}}" >> $GITHUB_ENV
38+
echo BUILD_SNAPSHOT="${{steps.get-version.outputs.snapshot}}" >> $GITHUB_ENV
39+
echo BUILD_PUBLISH="${{steps.get-version.outputs.publish}}" >> $GITHUB_ENV
40+
cat $GITHUB_ENV
41+
1842
test:
1943
name: test
2044

@@ -48,20 +72,8 @@ jobs:
4872
name: test-results-${{ matrix.os }}
4973
path: build/reports
5074

51-
check-publish:
52-
needs: [test]
53-
name: check publish
54-
55-
runs-on: ubuntu-latest
56-
if: >-
57-
github.actor != 'dependabot[bot]' && github.actor == 'hauner'
58-
59-
steps:
60-
- run: echo ${{ github.actor }} ${{ github.actor == 'hauner' }}
61-
- run: echo "should publish ..."
62-
6375
publish:
64-
needs: [check-publish]
76+
needs: [check-publish, test]
6577
name: publish snapshot
6678

6779
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)