-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (100 loc) · 3.13 KB
/
main.yml
File metadata and controls
123 lines (100 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Cross-Platform Compile and Publish
description: Compiles on multiple platforms and publishes to deken when tags are pushed
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "include/**"
- "src/**"
- "Makefile"
- "config.sh"
tags:
- 'v*'
pull_request:
paths:
- "include/**"
- "src/**"
- "Makefile"
- "config.sh"
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
PDVERSION: pd-0.56-2
steps:
- uses: actions/checkout@v6
# ---- platform-specific setup ----
- name: setup pd (unix)
if: matrix.os != 'windows-latest'
uses: ./.github/actions/setup-pd
- name: install mac deps
if: matrix.os == 'macos-latest'
run: brew install automake autoconf libtool
- name: setup windows deps
if: matrix.os == 'windows-latest'
run: |
echo "local_short_commands=true" >> $GITHUB_ENV
git submodule init && git submodule update
curl -O "http://msp.ucsd.edu/Software/$PDVERSION.msw.zip"
unzip "$PDVERSION.msw.zip"
# ---- build ----
- name: configure
run: bash config.sh
- name: make (unix)
if: matrix.os != 'windows-latest'
run: make PDINCLUDEDIR=pure-data/src
- name: make (windows)
if: matrix.os == 'windows-latest'
run: make pdbinpath="$PDVERSION/bin" PDINCLUDEDIR="$PDVERSION/src" CFLAGS=-march=x86-64
# ---- package ----
- name: package library
run: |
bash scripts/package_lib.sh "${{ matrix.os }}"
- name: upload artifact
uses: actions/upload-artifact@v6
with:
name: "fd_lib-${{ github.ref_name }}-${{ matrix.os }}-build"
path: "${{ matrix.os }}"
if-no-files-found: error
publish:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v6
- name: download all artifacts
uses: actions/download-artifact@v8
- name: Pull deken image
run: docker pull registry.git.iem.at/pd/deken
- name: create deken packages
run: |
ls -la
for artifact in fd_lib-*-build; do
echo "Packaging $artifact ..."
docker run --rm \
--user $(id -u) \
--volume ${{ github.workspace }}:/deken \
registry.git.iem.at/pd/deken \
deken package --name fd_lib --version "${{ github.ref_name }}" "$artifact"
done
- name: Upload all to deken
env:
DEKEN_USERNAME: ${{ secrets.DEKEN_USERNAME }}
DEKEN_PASSWORD: ${{ secrets.DEKEN_PASSWORD }}
run: |
ls -la
docker run --rm \
--user $(id -u) \
--volume ${{ github.workspace }}:/deken \
--env DEKEN_USERNAME \
--env DEKEN_PASSWORD \
registry.git.iem.at/pd/deken \
sh -c "deken upload *.dek"