forked from ernesst/ActivityTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (46 loc) · 1.9 KB
/
build.yaml
File metadata and controls
49 lines (46 loc) · 1.9 KB
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
# this file will build the app and create a downloadable artifact
name: Clickable build
on:
# start the script when code is pushed to main branch
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# define the build job
# only build if
# a) the keyword "run_ci" is part of the commit message
# b) no tag was pushed, because with a pushed tag another workflow is tiggered
jobs:
build:
if: |
contains(github.event.head_commit.message, 'run_ci') &&
github.event.head_commit.tag == ''
strategy:
# defining some matrix variables for later usage
matrix:
arch: [all] # can also be if needed [amd64, arm64, armhf]
appname: [activitytracker.cwayne18]
runs-on: ubuntu-latest
# defining all build steps that should be executed
steps:
- name: Checkout
uses: actions/checkout@v4 # here @latest doesn't work, specific version v4 or above
- name: Parse version
# extract the version number from manifest.json.in
# find the line with the version, split at " and take the 4th value
run: |
echo ARTIFACT_VERSION=$(cat manifest.json.in | grep "\"version\": " | awk -F'"' '$0=$4') >> $GITHUB_ENV
- name: Install clickable
# use python to install clickable so clickable commands can be used
run: |
python3 -m pip install clickable-ut
- name: Build
# build the app with clickable for all specified architectures
run: |
clickable build --arch ${{ matrix.arch }}
- name: Upload Artifacts
# upload the build artifacts to github using the appname and version
uses: actions/upload-artifact@v4 # here @latest doesn't work, specific version v4 or above
with:
name: ${{ matrix.appname }}_${{ env.ARTIFACT_VERSION }}_${{ matrix.arch }}.zip
path: build/*/app/*.click
if-no-files-found: error