Skip to content

Commit 9cbcf70

Browse files
committed
Semver
1 parent 365270e commit 9cbcf70

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,34 @@ name: Publish
33
on: push
44

55
jobs:
6+
vars:
7+
name: Get Variables
8+
runs-on: ubuntu-22.04
9+
outputs:
10+
version: ${{steps.version.outputs.version}}
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v6
15+
with:
16+
fetch-depth: 150
17+
fetch-tags: "true"
18+
19+
- name: Fetch Tags
20+
run: git fetch --tags
21+
22+
- name: Version
23+
id: version
24+
uses: paulhatch/semantic-version@v5.4.0
25+
with:
26+
version_format: "${major}.${minor}.${patch}"
27+
search_commit_body: true
28+
bump_each_commit: true
29+
630
publish:
731
name: Publish Code as Github Package - ${{ inputs.version }}
832
runs-on: ubuntu-22.04
33+
needs: vars
934
steps:
1035
- name: Checkout
1136
uses: actions/checkout@v6
@@ -22,6 +47,6 @@ jobs:
2247
- name: Publish
2348
run: ./gradlew :publish
2449
env:
25-
VERSION: ${{ inputs.version }}
50+
VERSION: ${{ needs.vars.outputs.version }}
2651
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
2752
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)