Skip to content

Commit 6ef1f73

Browse files
committed
CI/CD Updates
1 parent 97a5aa4 commit 6ef1f73

File tree

3 files changed

+184
-81
lines changed

3 files changed

+184
-81
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
name: Build
1+
name: Pre-releases
22
on: [push]
33

44
jobs:
55
test:
66
runs-on: ubuntu-latest
77
name: Run Tests
88
steps:
9-
- name: Checkout
9+
- name: Checkout Repository
1010
uses: actions/checkout@v4
11-
- name: Update apt
12-
run: yes | sudo apt-get update
13-
- name: Install rsync
14-
run: yes | sudo apt-get install rsync
1511
- name: Install Java
1612
uses: actions/setup-java@v4
1713
with:
@@ -21,89 +17,53 @@ jobs:
2117
- name: Build
2218
run: >
2319
cd build;
24-
ant clean;
25-
ant build
26-
- name: Test
27-
run: >
28-
cd build;
29-
ant test
30-
linux:
31-
runs-on: ubuntu-latest
32-
name: Build Linux
33-
needs: [test]
20+
ant -noinput build test;
21+
build:
22+
name: Create Pre-release for ${{ matrix.os_prefix }} (${{ matrix.arch }})
23+
needs: test
24+
runs-on: ${{ matrix.os }}
25+
permissions:
26+
contents: write
27+
strategy:
28+
matrix:
29+
include:
30+
# compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit)
31+
- os: self-hosted
32+
os_prefix: linux
33+
arch: arm
34+
- os: ubuntu-latest
35+
os_prefix: linux
36+
arch: x64
37+
- os: windows-latest
38+
os_prefix: windows
39+
arch: x64
40+
- os: macos-latest
41+
os_prefix: macos
42+
arch: x64
43+
- os: macos-latest
44+
os_prefix: macos
45+
arch: aarch64
46+
- os: macos-latest
47+
os_prefix: linux
48+
arch: aarch64
3449
steps:
35-
- name: Checkout
50+
- name: Checkout Repository
3651
uses: actions/checkout@v4
37-
- name: Update apt
38-
run: yes | sudo apt-get update
39-
- name: Install rsync
40-
run: yes | sudo apt-get install rsync
4152
- name: Install Java
4253
uses: actions/setup-java@v4
4354
with:
4455
java-version: '17'
4556
distribution: 'temurin'
46-
architecture: x64
47-
- name: Build linux
48-
run: >
49-
cd build;
50-
ant clean;
51-
ant build
57+
architecture: ${{ matrix.arch }}
58+
- name: Setup Ant
59+
uses: cedx/setup-ant@v3
60+
- name: Build Release
61+
run: ant -noinput -buildfile build/build.xml ${{ matrix.os_prefix }}-dist -Dversion="${{ github.sha }}"
5262
- name: Add artifact
53-
uses: actions/upload-artifact@v3
5463
if: ${{ github.ref == 'ref/head/main' }}
55-
with:
56-
name: linux
57-
path: ./build/linux/work
58-
mac:
59-
runs-on: macos-latest
60-
name: Build Mac
61-
needs: [test]
62-
steps:
63-
- name: Checkout
64-
uses: actions/checkout@v4
65-
- name: Install brew
66-
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
67-
- name: Install rsync
68-
run: brew install rsync
69-
- name: Install Java
70-
uses: actions/setup-java@v4
71-
with:
72-
java-version: '17'
73-
distribution: 'temurin'
74-
architecture: x64
75-
- name: Build mac
76-
run: >
77-
cd build;
78-
ant clean;
79-
ant build
80-
- name: Add artifact
8164
uses: actions/upload-artifact@v3
82-
if: ${{ github.ref == 'ref/head/main' }}
83-
with:
84-
name: macos
85-
path: ./build/macos/work
86-
windows:
87-
runs-on: windows-latest
88-
name: Build Windows
89-
needs: [test]
90-
steps:
91-
- name: Checkout
92-
uses: actions/checkout@v4
93-
- name: Install Java
94-
uses: actions/setup-java@v4
95-
with:
96-
java-version: '17'
97-
distribution: 'temurin'
98-
architecture: x64
99-
- name: Build
100-
run: >
101-
cd build;
102-
ant clean;
103-
ant build
104-
- name: Add artifact
105-
uses: actions/upload-artifact@v3
106-
if: ${{ github.ref == 'ref/head/main' }}
65+
id: upload
10766
with:
108-
name: windows
109-
path: ./build/windows/work
67+
name: processing-${{github.sha}}${{ matrix.os_prefix }}-${{ matrix.arch }}
68+
path: ./build/${{ matrix.os_prefix }}/processing-${{github.sha}}-${{ matrix.os_prefix}}-*
69+
retention-days: 1

.github/workflows/pull_request.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Pull Requests
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build:
9+
name: Create Pull Request Build for ${{ matrix.os_prefix }} (${{ matrix.arch }})
10+
runs-on: ${{ matrix.os }}
11+
permissions:
12+
pull-requests: write
13+
contents: read
14+
strategy:
15+
matrix:
16+
include:
17+
# compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit)
18+
- os: self-hosted
19+
os_prefix: linux
20+
arch: arm
21+
- os: ubuntu-latest
22+
os_prefix: linux
23+
arch: x64
24+
- os: windows-latest
25+
os_prefix: windows
26+
arch: x64
27+
- os: macos-latest
28+
os_prefix: macos
29+
arch: x64
30+
- os: macos-latest
31+
os_prefix: macos
32+
arch: aarch64
33+
- os: macos-latest
34+
os_prefix: linux
35+
arch: aarch64
36+
steps:
37+
- name: Checkout Repository
38+
uses: actions/checkout@v4
39+
- name: Install Java
40+
uses: actions/setup-java@v4
41+
with:
42+
java-version: '17'
43+
distribution: 'temurin'
44+
architecture: ${{ matrix.arch }}
45+
- name: Setup Ant
46+
uses: cedx/setup-ant@v3
47+
- name: Build Release
48+
run: ant -noinput -buildfile build/build.xml ${{ matrix.os_prefix }}-dist -Dversion="${{ github.sha }}"
49+
- name: Add artifact
50+
uses: actions/upload-artifact@v3
51+
id: upload
52+
with:
53+
name: processing-${{github.sha}}${{ matrix.os_prefix }}-${{ matrix.arch }}
54+
path: ./build/${{ matrix.os_prefix }}/processing-${{github.sha}}-${{ matrix.os_prefix}}-*
55+
retention-days: 5
56+
# TODO: Merge into one comment and fix the link
57+
# - uses: mshick/add-pr-comment@v2
58+
# with:
59+
# message-id: "build-artifact ${{ matrix.os_prefix }} ${{ matrix.arch }}"
60+
# message: |
61+
# Build artifacts for ${{ matrix.os_prefix }} (${{ matrix.arch }}) have been created.
62+
# Download the artifacts [here](${{ steps.upload.outputs.artifact-id }}).

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Releases
2+
on:
3+
push:
4+
tags:
5+
- processing-*
6+
7+
jobs:
8+
version:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
build_number: ${{ steps.tag_info.outputs.build_number }}
12+
version: ${{ steps.tag_info.outputs.version }}
13+
steps:
14+
- name: Extract version and build number
15+
id: tag_info
16+
shell: bash
17+
run: |
18+
TAG_NAME="${GITHUB_REF#refs/tags/}"
19+
BUILD_NUMBER=$(echo "$TAG_NAME" | cut -d'-' -f2)
20+
VERSION=$(echo "$TAG_NAME" | cut -d'-' -f3)
21+
22+
# Set outputs for use in later jobs or steps
23+
echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT
24+
echo "version=$VERSION" >> $GITHUB_OUTPUT
25+
build:
26+
name: Publish Release for ${{ matrix.os_prefix }} (${{ matrix.arch }})
27+
runs-on: ${{ matrix.os }}
28+
needs: version
29+
permissions:
30+
contents: write
31+
strategy:
32+
matrix:
33+
include:
34+
# compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit)
35+
- os: self-hosted
36+
os_prefix: linux
37+
arch: arm
38+
- os: ubuntu-latest
39+
os_prefix: linux
40+
arch: x64
41+
- os: windows-latest
42+
os_prefix: windows
43+
arch: x64
44+
- os: macos-latest
45+
os_prefix: macos
46+
arch: x64
47+
- os: macos-latest
48+
os_prefix: macos
49+
arch: aarch64
50+
- os: macos-latest
51+
os_prefix: linux
52+
arch: aarch64
53+
steps:
54+
- name: Checkout Repository
55+
uses: actions/checkout@v4
56+
- name: Install Java
57+
uses: actions/setup-java@v4
58+
with:
59+
java-version: '17'
60+
distribution: 'temurin'
61+
architecture: ${{ matrix.arch }}
62+
- name: Setup Ant
63+
uses: cedx/setup-ant@v3
64+
- name: Install Certificates for Code Signing
65+
if: ${{ matrix.os_prefix == 'macos' }}
66+
uses: apple-actions/import-codesign-certs@v3
67+
with:
68+
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
69+
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
70+
- name: Build Release
71+
run: ant -noinput -buildfile build/build.xml ${{ matrix.os_prefix }}-dist -Dversion="${{ needs.version.outputs.version }}"
72+
env:
73+
PROCESSING_APP_PASSWORD: ${{ secrets.PROCESSING_APP_PASSWORD }}
74+
PROCESSING_APPLE_ID: ${{ secrets.PROCESSING_APPLE_ID }}
75+
PROCESSING_TEAM_ID: ${{ secrets.PROCESSING_TEAM_ID }}
76+
- name: Upload binaries to release
77+
uses: svenstaro/upload-release-action@v2
78+
with:
79+
repo_token: ${{ secrets.GITHUB_TOKEN }}
80+
file: ./build/${{ matrix.os_prefix }}/processing-${{ needs.version.outputs.version }}-${{ matrix.os_prefix}}-*
81+
file_glob: true

0 commit comments

Comments
 (0)