Skip to content

Commit dee95fe

Browse files
committed
chore: add version
1 parent ce85187 commit dee95fe

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/layer.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,36 @@ permissions:
1111
id-token: write
1212

1313
jobs:
14+
get-version:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
version: ${{ steps.get_version.outputs.version }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Get version
22+
id: get_version
23+
run: |
24+
if [ -f package.oo.yaml ]; then
25+
version=$(yq eval '.version' package.oo.yaml)
26+
echo "version=$version" >> "$GITHUB_OUTPUT"
27+
elif [ -f package.oo.yml ]; then
28+
version=$(yq eval '.version' package.oo.yml)
29+
echo "version=$version" >> "$GITHUB_OUTPUT"
30+
else
31+
echo "No valid package file found"
32+
exit 1
33+
fi
34+
1435
export-layer:
36+
needs: get-version
1537
permissions:
1638
contents: read
1739
id-token: write
1840

1941
uses: oomol/ovmlayer-rootfs/.github/workflows/export-package-layer.yml@main
2042
with:
2143
package-name: "layer-example"
22-
version: "0.0.1"
44+
version: "${{ needs.get-version.outputs.version }}"
2345
secrets:
2446
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)