|
15 | 15 |
|
16 | 16 | jobs: |
17 | 17 |
|
18 | | - version: |
19 | | - name: check version |
| 18 | + check-publish: |
| 19 | + name: check publish |
20 | 20 | runs-on: ubuntu-latest |
21 | 21 | outputs: |
22 | 22 | BUILD_VERSION: ${{ env.BUILD_VERSION }} |
| 23 | + BUILD_SNAPSHOT: ${{ env.BUILD_SNAPSHOT }} |
| 24 | + BUILD_PUBLISH: ${{ env.BUILD_PUBLISH }} |
23 | 25 |
|
24 | 26 | steps: |
25 | | - - name: Set up Homebrew |
26 | | - id: set-up-homebrew |
27 | | - uses: Homebrew/actions/setup-homebrew@master |
28 | | - |
29 | | - - name: checkout |
30 | | - uses: actions/checkout@v6 |
31 | | - |
32 | | - - name: install dasel |
| 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.openapiparser' |
| 33 | + |
| 34 | + - name: set version outputs |
| 35 | + shell: bash |
33 | 36 | run: | |
34 | | - brew install dasel |
| 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 |
35 | 40 | cat $GITHUB_ENV |
36 | 41 |
|
37 | | - - name: extract version |
38 | | - run: | |
39 | | - version=`cat gradle/libs.versions.toml | dasel -i toml 'versions.openapiparser'` |
40 | | - echo "BUILD_VERSION=${version#projectVersion=}" >> $GITHUB_ENV |
41 | | - cat $GITHUB_ENV |
| 42 | +# version: |
| 43 | +# name: check version |
| 44 | +# runs-on: ubuntu-latest |
| 45 | +# outputs: |
| 46 | +# BUILD_VERSION: ${{ env.BUILD_VERSION }} |
| 47 | +# |
| 48 | +# steps: |
| 49 | +# - name: Set up Homebrew |
| 50 | +# id: set-up-homebrew |
| 51 | +# uses: Homebrew/actions/setup-homebrew@master |
| 52 | +# |
| 53 | +# - name: checkout |
| 54 | +# uses: actions/checkout@v6 |
| 55 | +# |
| 56 | +# - name: install dasel |
| 57 | +# run: | |
| 58 | +# brew install dasel |
| 59 | +# cat $GITHUB_ENV |
| 60 | +# |
| 61 | +# - name: extract version |
| 62 | +# run: | |
| 63 | +# version=`cat gradle/libs.versions.toml | dasel -i toml 'versions.openapiparser'` |
| 64 | +# echo "BUILD_VERSION=${version#projectVersion=}" >> $GITHUB_ENV |
| 65 | +# cat $GITHUB_ENV |
42 | 66 |
|
43 | 67 | test: |
44 | 68 | name: test |
@@ -76,23 +100,24 @@ jobs: |
76 | 100 | name: test-results-${{ matrix.os }} |
77 | 101 | path: '*/build/reports' |
78 | 102 |
|
79 | | - check-publish: |
80 | | - needs: [version, test] |
81 | | - name: check publish |
82 | | - |
83 | | - runs-on: ubuntu-latest |
84 | | - if: >- |
85 | | - github.actor != 'dependabot[bot]' && |
86 | | - github.actor == 'hauner' && contains(needs.version.outputs.BUILD_VERSION, 'SNAPSHOT') |
87 | | -
|
88 | | - steps: |
89 | | - - run: echo "should publish ..." |
| 103 | +# check-publish: |
| 104 | +# needs: [version, test] |
| 105 | +# name: check publish |
| 106 | +# |
| 107 | +# runs-on: ubuntu-latest |
| 108 | +# if: >- |
| 109 | +# github.actor != 'dependabot[bot]' && |
| 110 | +# github.actor == 'hauner' && contains(needs.version.outputs.BUILD_VERSION, 'SNAPSHOT') |
| 111 | +# |
| 112 | +# steps: |
| 113 | +# - run: echo "should publish ..." |
90 | 114 |
|
91 | 115 | publish: |
92 | 116 | needs: [check-publish] |
93 | 117 | name: publish snapshot |
94 | 118 |
|
95 | 119 | runs-on: ubuntu-latest |
| 120 | + if: needs.check-publish.outputs.BUILD_PUBLISH == 'true' |
96 | 121 |
|
97 | 122 | steps: |
98 | 123 | - name: checkout |
|
0 commit comments