Skip to content

Commit 230a220

Browse files
committed
build pbw in CI
1 parent 6ef443f commit 230a220

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/build-pbw.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build Pebble app
2+
3+
on:
4+
# Triggers the workflow on push or pull request events for any branch (see commented out `branches` lines for master branch example)
5+
push:
6+
branches: [pbw-action]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-24.04
11+
container:
12+
# Pebble SDK needs Python 2.7
13+
image: python:2.7.18-buster
14+
15+
steps:
16+
# Sanity checks for debugging, if/when problems occur
17+
- name: pyver
18+
run: python --version
19+
- name: whichpy
20+
run: which python
21+
- name: whichpy2
22+
run: which python2
23+
- name: whichpy3
24+
run: which python3
25+
26+
- name: Clone Repository (Latest)
27+
uses: actions/checkout@v4
28+
if: github.event.inputs.git-ref == ''
29+
- name: Clone Repository (Custom Ref)
30+
uses: actions/checkout@v4
31+
if: github.event.inputs.git-ref != ''
32+
with:
33+
ref: ${{ github.event.inputs.git-ref }}
34+
- name: Set short git commit SHA
35+
id: vars
36+
run: |
37+
calculatedSha=$(git rev-parse --short ${{ github.sha }})
38+
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
39+
- uses: actions/setup-node@v4
40+
- name: apt-get
41+
run: apt-get update; apt-get -qq install -y wget python-pip python2.7-dev libsdl1.2debian libfdt1 libpixman-1-0 nodejs npm libfreetype6 libx11-6 rlwrap
42+
- name: virtualenv
43+
run: pip install virtualenv
44+
- name: get sdk
45+
run: if [ ! -d sdk ]; then mkdir sdk && wget -q -O - https://developer.rebble.io/s3.amazonaws.com/assets.getpebble.com/pebble-tool/pebble-sdk-4.5-linux64.tar.bz2 | tar xj --strip-components=1 -C sdk; fi
46+
- name: requirements
47+
run: if [ ! -d sdk/.env ]; then cd sdk && virtualenv .env && bash -c "source .env/bin/activate && pip install -r requirements.txt && deactivate" && cd ..; fi
48+
- name: sdk-core
49+
run: if [ ! -f sdk/sdk-core-4.3.tar.bz2 ]; then wget https://github.com/aveao/PebbleArchive/raw/master/SDKCores/sdk-core-4.3.tar.bz2 -O sdk/sdk-core-4.3.tar.bz2; fi
50+
- name: install sdk
51+
run: if [ ! -d ~/.pebble-sdk ]; then mkdir -p ~/.pebble-sdk && touch ~/.pebble-sdk/NO_TRACKING && sdk/bin/pebble sdk install sdk/sdk-core-4.3.tar.bz2; fi
52+
- name: pebble-build
53+
run: cd app/ && yes | ../sdk/bin/pebble build
54+
- name: rename-app
55+
run: cp app/build/app.pbw Bobby-g${{ env.COMMIT_SHORT_SHA }}.pbw
56+
- name: Upload PBW
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: Bobby PBW
60+
path: Bobby-g${{ env.COMMIT_SHORT_SHA }}.pbw
61+
if-no-files-found: error

0 commit comments

Comments
 (0)