Skip to content

Commit 770410c

Browse files
committed
ci: extract check-version action for re-use
1 parent dfd48f2 commit 770410c

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: check-version
2+
description: check release/snapshot version
3+
inputs:
4+
version-file:
5+
description: 'the version file'
6+
required: true
7+
default: 'gradle/libs.versions.toml'
8+
version-path:
9+
description: 'the version path'
10+
required: true
11+
default: 'versions.processor'
12+
outputs:
13+
build-version:
14+
description: "the build version"
15+
value: ${{ steps.extract-version.outputs.build-version }}
16+
runs:
17+
using: 'composite'
18+
steps:
19+
- name: Set up Homebrew
20+
id: set-up-homebrew
21+
uses: Homebrew/actions/setup-homebrew@main
22+
23+
- name: checkout
24+
uses: actions/checkout@v6
25+
26+
- name: install dasel
27+
shell: bash
28+
run: |
29+
brew install dasel
30+
cat $GITHUB_ENV
31+
32+
- name: extract version
33+
id: extract-version
34+
shell: bash
35+
run: |
36+
version=`cat ${{inputs.version-file}} | dasel -i toml '${{inputs.version-path}}'`
37+
echo BUILD_VERSION="${version#projectVersion=}" >> $GITHUB_ENV
38+
cat $GITHUB_ENV
39+
40+
- name: actor
41+
shell: bash
42+
run: echo ${{ github.actor }}

0 commit comments

Comments
 (0)