Skip to content

Commit 4b7503f

Browse files
committed
SWPROT-8953: ci: github: Upload artifacts
This can help developer and check pipelines, dist folder may be adjusted over time Origin: SiliconLabs/UnifySDK#50 Forwarded: #4 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent f759e92 commit 4b7503f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/build.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,28 @@ on: # yamllint disable-line rule:truthy
88

99
jobs:
1010
build:
11+
env:
12+
project-name: unifysdk # This should be lowercase for docker (and aligned)
1113
runs-on: ubuntu-22.04
1214
steps:
1315
- uses: actions/checkout@v4.1.1
1416
with:
1517
fetch-depth: 0
18+
- id: describe
19+
name: Describe HEAD
20+
run: >-
21+
echo "describe=$(git describe --tags --always || echo 0)"
22+
| tee $GITHUB_OUTPUT
1623
- name: Build Docker image from sources
17-
run: docker build .
24+
run: docker build --tag "${{ env.project-name }}:latest" .
25+
- name: Extract artifacts
26+
run: >-
27+
container=$(docker create "${{ env.project-name }}:latest")
28+
&& docker cp
29+
${container}:/usr/local/opt/${{ env.project-name }}/build/dist .
30+
- name: Upload artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
# yamllint disable-line
34+
name: ${{ github.event.repository.name }}-${{ steps.describe.outputs.describe }}
35+
path: dist/

0 commit comments

Comments
 (0)