Skip to content

Commit 7cbd63a

Browse files
authored
Enhance publish workflow to include version input and update devcontainer-feature.json
1 parent 1398c01 commit 7cbd63a

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/publish-feature.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Publish Devcontainer Feature
22

33
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
description: 'The version to publish'
8+
required: true
9+
type: string
410
release:
511
types: [created]
612

@@ -17,5 +23,18 @@ jobs:
1723
- name: Login to GitHub Container Registry
1824
run: echo "${{ secrets.WRITE_PACKAGES_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
1925

26+
- name: Add version to environment
27+
run: |
28+
VERSION="${{ inputs.version || github.ref_name }}"
29+
echo "VERSION=$VERSION" >> $GITHUB_ENV
30+
31+
- name: Add version to devcontainer-feature.json
32+
run: |
33+
jq --arg VERSION "${{ env.VERSION }}" '.version = $VERSION' src/cvmfs/devcontainer-feature.json > tmp.json
34+
mv tmp.json src/cvmfs/devcontainer-feature.json
35+
2036
- name: Publish Devcontainer Feature
21-
run: devcontainer features publish src/cvmfs --namespace cvmfs-contrib
37+
run: devcontainer features publish --namespace ${{ github.actor }}/${{ github.repository }} .
38+
39+
- name: Build Devcontainer Feature
40+
run: devcontainer build --workspace-folder . --image-name test-cvmfs-feature --additional-features ghcr.io/${{ github.actor }}/${{ github.repository }}/cvmfs:${{ env.VERSION }}

0 commit comments

Comments
 (0)