Skip to content

debug actions

debug actions #37

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install tools
run: |
sudo apt update
sudo apt install -y xmlstarlet
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: paulhatch/semantic-version@v5.1.0
id: semver
with:
tag_prefix: "v"
# A string to determine the format of the version output
# version_format: "${major}.${minor}.${patch}-prerelease${increment}"
version_format: "${major}.${minor}.${patch}"
# If this is set to true, *every* commit will be treated as a new version.
bump_each_commit: true
# If bump_each_commit is also set to true, setting this value will cause the version to increment only if the pattern specified is matched.
search_commit_body: false
- name: Use the version
run: |
echo ${{ steps.semver.outputs.version }}
- name: Get SDK
env:
CONNECTIQ_SDK_URL: "https://developer.garmin.com/downloads/connect-iq/sdks"
SDK_VER: "4.2.4"
run: |
filename=$(curl -s "$CONNECTIQ_SDK_URL/sdks.json" | jq -r --arg version "$SDK_VER" '.[] | select(.version=="'$SDK_VER'") | .linux')
echo "$filename:$SDK_VER"
echo "$CONNECTIQ_SDK_URL/$filename"
# sudo curl "$CONNECTIQ_SDK_URL/$filename" --output /tmp/connectiq.zip;
# sudo unzip /tmp/connectiq.zip -d /garminsdk
- name: Get Devices
env:
AZURE_KEYS_SAS: ${{ secrets.AZURE_KEYS_SAS }}
run: |
curl "https://ibglobalstorage.blob.core.windows.net/garmin-ci/Devices.zip$AZURE_KEYS_SAS" --output /tmp/devices.zip
sudo mkdir -p /root/.Garmin/ConnectIQ/
sudo unzip /tmp/devices.zip -d /root/.Garmin/ConnectIQ/
- name: Write Version
run: |
cat <<EOF > ./resources/settings/version.xml
<strings><string id="AppVersionValue">${{ steps.semver.outputs.version }}</string></strings>
EOF
- name: Write appId
env:
APP_ID: ${{ secrets.APP_ID }}
run: |
xmlstarlet ed -u '/iq:manifest/iq:application/@id' -v $APP_ID manifest.xml
- name: Write Secrets
env:
WATCHSERVER_KEY: ${{ secrets.WATCHSERVER_KEY }}
run: |
cat <<EOF > ./resources/settings/secrets.xml
<strings><string id="LocationApiKeyValue">not_used</string><string id="IsTest">0</string><string id="ExchangeApiKeyValue">not_used</string><string id="WatchServerTokenValue">$WATCHSERVER_KEY</string></strings>
EOF
- name: Download App Key
env:
AZURE_KEYS_SAS: ${{ secrets.AZURE_KEYS_SAS }}
run: |
curl "https://ibglobalstorage.blob.core.windows.net/garmin-ci/YAWatchFace.key$AZURE_KEYS_SAS" --output ./app.key
- name: Generate Device Files
run: |
for f in $(xmlstarlet select -t -v '//iq:product/@id' manifest.xml)
do
mkdir -p ./resources-$f
echo '<strings><string id="DeviceName">'$f'</string></strings>' > ./resources-$f/device.xml
done
- name: Build
run: |
sudo java -cp /garminsdk/bin/monkeybrains.jar com.garmin.monkeybrains.Monkeybrains -o /release/yas-${{ steps.semver.outputs.version }}.iq -f ./monkey.jungle -y ./app.key -e -w -r -l 0
- name: Publish build result
env:
AZURE_RELEASE_SAS: ${{ secrets.AZURE_RELEASE_SAS }}
run: |
curl -H "x-ms-blob-type: BlockBlob" --upload-file /release/yas-${{ steps.semver.outputs.version }}.iq --url "https://ibglobalstorage.blob.core.windows.net/garmin-yawf-release/yas-${{ steps.semver.outputs.version }}.iq$AZURE_RELEASE_SAS"