-
Notifications
You must be signed in to change notification settings - Fork 48
151 lines (147 loc) · 5.69 KB
/
build-appimage.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Build AppImage
on:
workflow_dispatch:
inputs:
package-name:
description: "Bambu AppImage name"
required: true
default: "bambu-gcc7_clang11"
branch:
description: "Repository branch to build from"
required: false
default: "main"
compilers:
description: "Comma separated list of compilers to include"
required: true
default: "gcc-7,clang-12"
build-compiler:
description: "Compiler used to build bambu (if not already included in compilers)"
required: false
default: "gcc-8"
configure:
description: "Bambu configuration options"
required: true
default: "--enable-glpk --enable-flopoco --enable-opt --with-opt-level=2 --enable-release CC=gcc-8 CXX=g++-8 --with-gcc8=/bin/false"
workflow_call:
inputs:
package-name:
description: "Bambu AppImage package name"
required: true
type: string
compilers:
description: "Comma separated list of compilers to include"
required: false
type: string
default: "gcc-7,clang-12"
build-compiler:
description: "Compiler used to build bambu (if not already included in compilers)"
required: false
type: string
default: "gcc-8"
configure:
description: "Bambu configuration options"
required: false
type: string
default: "--enable-glpk --enable-flopoco --enable-opt --with-opt-level=2 --enable-release CC=gcc-8 CXX=g++-8 --with-gcc8=/bin/false"
upload_config:
description: "Upload configuration <CI|release|both>"
required: false
type: string
default: "CI"
secrets:
CI_STORAGE_URL:
required: true
CI_STORAGE_USER:
required: true
CI_STORAGE_TOKEN:
required: true
outputs:
package-name:
description: "Package name to download built AppImage"
value: ${{jobs.build.outputs.package-name}}
env:
compilers: ${{inputs.compilers}}
build-compiler: ${{inputs.build-compiler}}
configure: ${{inputs.configure}}
storage-url: ${{secrets.CI_STORAGE_URL}}
storage-user: ${{secrets.CI_STORAGE_USER}}
storage-token: ${{secrets.CI_STORAGE_TOKEN}}
storage-path: release
package-name: ${{inputs.package-name}}
dist-dir: dist
bcompiler-dir: compiler
host_jobs: $J
upload_config: ${{inputs.upload_config}}
local-compilers-backup: $LOCAL_COMPILERS_BACKUP
jobs:
build:
runs-on: [self-hosted]
outputs:
package-name: ${{env.package-name}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{inputs.branch}}
- name: Env setup
id: setup
shell: bash
run: |
echo "Current host supports ${{env.host_jobs}} parallel jobs"
echo "jobs=${{env.host_jobs}}" >> $GITHUB_OUTPUT
env_id="$(echo $(sed 's/,/\n/g' <<< "${{env.compilers}}" | sort -V) | sed 's/ //g')"
if [[ ! -z "${{env.build-compiler}}" ]]; then
if [[ "$env_id" != *"${{env.build-compiler}}"* ]]; then
env_id+="${{env.build-compiler}}"
fi
fi
echo "version=$(cat configure.ac | grep AC_INIT | sed -E 's/.*,(.*),.*/\1/g;s/ //g')" >> $GITHUB_OUTPUT
echo "env_id=$env_id" >> $GITHUB_OUTPUT
echo "timestamp=$(date -u +'%Y-%m-%d-%H;%M;%S')" >> $GITHUB_OUTPUT
- name: CCache cache files
uses: actions/cache@v3
with:
path: .ccache
key: panda-build-ccache-${{steps.setup.outputs.version}}-${{ steps.setup.outputs.timestamp }}
restore-keys: |
panda-build-ccache-${{steps.setup.outputs.version}}-
- name: Autoconf cache files
uses: actions/cache@v3
with:
path: .autoconf
key: panda-build-autoconf-${{steps.setup.outputs.version}}-${{ steps.setup.outputs.env_id }}-${{ steps.setup.outputs.timestamp }}
restore-keys: |
panda-build-autoconf-${{steps.setup.outputs.version}}-${{ steps.setup.outputs.env_id }}-
- name: Download compilers
shell: bash
run: |
mkdir ${{env.dist-dir}}
bash ./.devcontainer/library-scripts/compiler-download.sh "${{env.dist-dir}}" "${{env.compilers}}" "${{env.local-compilers-backup}}"
if [[ ! -z "${{env.build-compiler}}" ]]; then
mkdir ${{env.bcompiler-dir}}
bash ./.devcontainer/library-scripts/compiler-download.sh "${{env.bcompiler-dir}}" "${{env.build-compiler}}" "${{env.local-compilers-backup}}"
fi
- name: Build Bambu application
id: build
uses: ./.github/actions/generate-appimage
with:
config-args: ${{env.configure}} --enable-Werror
jobs: ${{steps.setup.outputs.jobs}}
- name: Upload PandA Bambu HLS AppImage for CI
if: ${{ env.upload_config != '' && env.upload_config != 'release' }}
uses: ./.github/actions/storage-upload
with:
name: ${{env.package-name}}
path: ${{steps.build.outputs.appimage}}
storage-url: ${{env.storage-url}}
username: "${{env.storage-user}}"
password: "${{env.storage-token}}"
storage-compression: false
- name: Upload Panda Bambu HLS Release
if: ${{ env.upload_config != 'CI' }}
shell: bash
run: |
APP_FILE="${{env.package-name}}.AppImage"
STORAGE_URL="${{env.storage-url}}/${{env.storage-path}}/$APP_FILE"
curl -L --fail -u '${{env.storage-user}}':'${{env.storage-token}}' -T "${{steps.build.outputs.appimage}}" "$STORAGE_URL"
echo "### New release available at https://release.bambuhls.eu/appimage/$APP_FILE" >> $GITHUB_STEP_SUMMARY