## Changes v1.1.0 #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this file will build the app, create a downloadable artifact, publish the app to OpenStore and create a release with the build app as asset | |
name: Clickable build, publish and release | |
on: | |
# start the script when a tag is pushed | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# define the build job | |
jobs: | |
build: | |
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 | |
- name: Publish to Open Store | |
# if a tag has been pushed, publish to OpenStore using the API key specified as Github secret with the last commit message (=changelog) as content | |
env: | |
OPENSTORE_KEY: ${{ secrets.OPENSTORE_KEY }} | |
run: clickable publish "* $(git log -1 --pretty=%B | head -1)" --apikey ${OPENSTORE_KEY} | |
- name: Create Release | |
# if a tag has been pushed, create a release with the last commit message (=changelog) as content | |
id: create_release | |
uses: softprops/action-gh-release@latest # need to get tested if this works, otherwise use v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: "* $(git log -1 --pretty=%B)" | |
draft: false | |
prerelease: false | |
files: ${{ matrix.appname }}_${{ env.ARTIFACT_VERSION }}_${{ matrix.arch }}.zip | |
fail_on_unmatched_files: false |