Skip to content

Commit dca56b2

Browse files
committed
fix(workflows): Versions the package before any build is happening
1 parent c1c5d79 commit dca56b2

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

template/.github/workflows/package-development-workflow.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
ref:
1818
required: true
1919
type: string
20+
version:
21+
required: true
22+
type: string
2023

2124
permissions:
2225
contents: read # required for checkout
@@ -50,6 +53,24 @@ jobs:
5053
with:
5154
immutable: true
5255

56+
- name: Determine version
57+
id: determine_version
58+
shell: bash
59+
run: |
60+
INPUT_VERSION="${{ inputs.version }}"
61+
SHA_SHORT="${{ github.sha }}"
62+
63+
if [ -z "$INPUT_VERSION" ]; then
64+
echo "version=0.0.1-${SHA_SHORT}" >> $GITHUB_OUTPUT
65+
else
66+
echo "version=${INPUT_VERSION}" >> $GITHUB_OUTPUT
67+
fi
68+
69+
- name: Version the package
70+
uses: simatic-ax/actions/apax-version@v3
71+
with:
72+
version: ${{ steps.determine_version.outputs.version }}
73+
5374
- name: Build source code
5475
uses: simatic-ax/actions/apax-build@v3
5576

template/.github/workflows/package-release-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
APAX_TOKEN: ${{ secrets.APAX_TOKEN }}
2020
with:
2121
ref: ${{ github.event.release.target_commitish }}
22+
version: ${{ github.event.release.tag_name }}
2223

2324
release:
2425
name: Release the package

0 commit comments

Comments
 (0)