-
Notifications
You must be signed in to change notification settings - Fork 27
63 lines (58 loc) · 1.89 KB
/
build-deb.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Build Deb
on:
push:
branches: [ develop, '**-release', 'release-**' ]
workflow_dispatch:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
build-deb:
runs-on: ubuntu-22.04
env:
SGX_MODE: HW
VERSION: "1.0.5"
PRODUCTION_MODE: true
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Retrieve the secret and decode it to a file
env:
ENCLAVE_PK_BASE64: ${{ secrets.ENCLAVE_PK_BASE64 }}
run: |
rm sgxvm/Enclave_dev_private.pem || true
rm sgxvm/Enclave_private.pem || true
echo $ENCLAVE_PK_BASE64 | base64 --decode > sgxvm/Enclave_private.pem
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get version
id: get_version
uses: battila7/get-version-action@v2
- name: Build .deb Package Image
uses: docker/build-push-action@v4
with:
file: ./docker/deb.Dockerfile
context: .
load: true
tags: deb_build
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
SGX_MODE=HW
ENCLAVE_HOME="/usr/lib/"
PRODUCTION_MODE=true
target: build-deb
- name: Run .deb Package Image
run: |
docker run -e VERSION=${{ env.VERSION }} -v $GITHUB_WORKSPACE/build:/build deb_build
cp build/swisstronik_${{ env.VERSION }}_amd64.deb swisstronik_${{ env.VERSION }}_amd64.deb
- uses: actions/upload-artifact@v3
with:
name: swisstronik_${{ env.VERSION }}_amd64.deb
path: swisstronik_${{ env.VERSION }}_amd64.deb