Skip to content

Commit 8d07ccc

Browse files
committed
Release workflow
1 parent b029986 commit 8d07ccc

4 files changed

Lines changed: 89 additions & 34 deletions

File tree

.github/actions/create/action.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Setup & Build Android Mode"
2+
description: "Setup and build the Processing Android Mode"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Install Java
7+
uses: actions/setup-java@v4
8+
with:
9+
java-version: '17'
10+
distribution: 'temurin'
11+
12+
- name: Setup Gradle
13+
uses: gradle/actions/setup-gradle@v4
14+
15+
- name: Setup Android SDK
16+
uses: android-actions/setup-android@v3
17+
18+
- name: Build with Gradle
19+
run: |
20+
echo sdk.dir=/usr/local/lib/android/sdk/ >> local.properties
21+
./gradlew libs:processing-core:build
22+
23+
- name: Create the mode
24+
run: |
25+
cd processing
26+
echo sdk.dir=/usr/local/lib/android/sdk/ >> local.properties
27+
./gradlew dist

.github/workflows/build.yml

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,13 @@ jobs:
1313
steps:
1414
- name: Checkout Repository
1515
uses: actions/checkout@v4
16-
- name: Checkout Examples Repository
17-
uses: actions/checkout@v4
18-
with:
19-
repository: processing/processing-examples
20-
path: processing-examples
21-
- name: Install Java
22-
uses: actions/setup-java@v4
23-
with:
24-
java-version: '17'
25-
distribution: 'temurin'
26-
- name: Setup Gradle
27-
uses: gradle/actions/setup-gradle@v4
16+
17+
- name: Setup and Build Android Mode
18+
uses: ./.github/actions/create
2819

29-
- name: Setup Android SDK
30-
uses: android-actions/setup-android@v3
31-
32-
- name: Build with Gradle
33-
run: |
34-
echo sdk.dir=/usr/local/lib/android/sdk/ >> local.properties
35-
./gradlew libs:processing-core:build libs:processing-ar:build libs:processing-vr:build
36-
37-
- name: Create the mode
38-
run: |
39-
cd processing
40-
echo sdk.dir=/usr/local/lib/android/sdk/ >> local.properties
41-
./gradlew extractAarJars dist
42-
# - name: Add artifact
43-
# uses: actions/upload-artifact@v4
44-
# with:
45-
# name: processing-${{ github.ref_name }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-ant
46-
# path: ./build/${{ matrix.os_prefix }}/processing-${{github.sha}}-${{ matrix.os_prefix}}-*
47-
# retention-days: 1
20+
- name: Add artifact
21+
uses: actions/upload-artifact@v4
22+
with:
23+
name: AndroidMode
24+
path: ./processing/dist/AndroidMode.zip
25+
retention-days: 1

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Releases
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_number:
6+
description: "What is the version number?"
7+
required: true
8+
version_pretty:
9+
description: "What is the pretty version name?"
10+
required: true
11+
12+
jobs:
13+
build:
14+
name: Build Android Mode Release
15+
runs-on: ubuntu-latest
16+
permissions:
17+
packages: write
18+
contents: write
19+
20+
steps:
21+
- name: Checkout Repository
22+
uses: actions/checkout@v4
23+
24+
# replace the version numbers in ./processing/mode/mode.properties
25+
- name: Set Version Number
26+
run: |
27+
VERSION_NUMBER=${{ github.event.inputs.version_number }}
28+
VERSION_PRETTY=${{ github.event.inputs.version_pretty }}
29+
echo "Setting version to $VERSION_NUMBER ($VERSION_PRETTY)"
30+
sed -i "s/^version=.*$/version=$VERSION_NUMBER/" ./processing/mode/mode.properties
31+
sed -i "s/^vprettyVersion=.*$/prettyVersion=$VERSION_PRETTY/" ./processing/mode/mode.properties
32+
cat ./processing/mode/mode.properties
33+
34+
- name: Setup and Build Android Mode
35+
uses: ./.github/actions/create
36+
37+
- name: Add artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: AndroidMode
41+
path: ./processing/dist/AndroidMode.zip
42+
retention-days: 1
43+
44+
- name: Create a Release
45+
uses: elgohr/Github-Release-Action@v5
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
title: Release Android Mode
50+
prerelease: true

processing/mode/mode.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ url = https://android.processing.org
44
sentence = This mode lets you use Processing to create Android apps
55
paragraph =
66
imports=processing.mode.java.JavaMode
7-
version = 412
8-
prettyVersion = 4.6.0
97
minRevision = 1283
10-
maxRevision = 0
8+
maxRevision = 0
9+
version = 412
10+
prettyVersion = 4.6.0

0 commit comments

Comments
 (0)