Skip to content

add condition for triggering a build on demand #15

add condition for triggering a build on demand

add condition for triggering a build on demand #15

Workflow file for this run

# 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
jobs:
build:
if: "contains(github.event.head_commit.message,'run_ci')"
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