Skip to content

Commit 733fb50

Browse files
committed
University Workshops: add workflow
1 parent 02951e6 commit 733fb50

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: University Workshops Build
2+
on:
3+
push:
4+
branches:
5+
- university-workshops
6+
paths-ignore:
7+
- 'docs/**'
8+
9+
jobs:
10+
Build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
build_type: [cora, workshops]
15+
fail-fast: false
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set env variables
19+
run: |
20+
BRANCH=$GITHUB_REF_NAME
21+
branch_name=$(echo $BRANCH | tr 'a-z' 'A-Z' | sed 's/[^[:alnum:]]/_/g')
22+
type=$( echo ${{ matrix.build_type }} | tr 'a-z' 'A-Z')
23+
echo ARTIFACT_NAME=ftc25_"${{ matrix.build_type }}" >> $GITHUB_ENV
24+
echo BRANCH_NAME="$branch_name"_"$type" >> $GITHUB_ENV
25+
- name: Build image
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y qemu-user-static
29+
# remove container if already exists
30+
CONTAINER_NAME=$(grep -m1 -oP '^[#]?CONTAINER_NAME=\K.*' ./config)
31+
if [ "$(docker ps -a -q -f name=^/${CONTAINER_NAME}$)" ]; then
32+
docker rm -fv "$CONTAINER_NAME"
33+
fi
34+
35+
rm config && mv config-${{ matrix.build_type }} config
36+
sudo bash build-docker.sh
37+
ls kuiper-volume/*.zip >/dev/null 2>&1 && exit 0 || exit 2
38+
- name: Upload image
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: ${{ env.ARTIFACT_NAME }}_image
42+
path: ${{ github.workspace }}/kuiper-volume/*.zip
43+
- name: Upload meta
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: ${{ env.ARTIFACT_NAME }}_meta
48+
path: |
49+
${{ github.workspace }}/kuiper-volume
50+
!${{ github.workspace }}/kuiper-volume/*.zip
51+

0 commit comments

Comments
 (0)