Skip to content

Commit 0eae101

Browse files
committed
fix gh actions
1 parent e6d7690 commit 0eae101

3 files changed

Lines changed: 43 additions & 48 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Setup Deken
2+
description: Download and install the deken commandline utility.
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: install deken
8+
shell: bash
9+
run: |
10+
curl -L https://raw.githubusercontent.com/pure-data/deken/main/developer/deken -o deken
11+
chmod +x deken
12+
deken --version

.github/actions/setup-pd/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ description: Checkout code and setup Pure Data dependencies
44
runs:
55
using: composite
66
steps:
7-
- uses: actions/checkout@v5
87
- name: get pdlibbuilder
9-
run: git submodule init && git submodule update
108
shell: bash
9+
run: |
10+
git submodule init
11+
git submodule update
1112
1213
- name: get pd
13-
uses: actions/checkout@v5
14+
uses: actions/checkout@v6
1415
with:
1516
repository: pure-data/pure-data
1617
path: pure-data

.github/workflows/main.yml

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- "src/**"
1010
- "Makefile"
1111
- "config.sh"
12+
tags: ['v*']
1213

1314
pull_request:
1415
paths:
@@ -33,7 +34,10 @@ jobs:
3334
PDVERSION: pd-0.56-2
3435

3536
steps:
36-
- uses: actions/checkout@v5
37+
- uses: actions/checkout@v6
38+
39+
- name: setup deken
40+
uses: ./.github/actions/setup-deken
3741

3842
# ---- platform-specific setup ----
3943
- name: setup pd (unix)
@@ -65,66 +69,44 @@ jobs:
6569
run: make pdbinpath="$PDVERSION/bin" PDINCLUDEDIR="$PDVERSION/src" CFLAGS=-march=x86-64
6670

6771
# ---- package ----
68-
- name: package (unix)
69-
if: matrix.os != 'windows-latest'
70-
run: make install PDLIBDIR="${{ matrix.os }}"
71-
- name: package (windows)
72-
if: matrix.os == 'windows-latest'
72+
- name: package library
7373
run: |
7474
bash scripts/package_lib.sh
7575
ls -la
7676
mkdir -p "${{ matrix.os }}"
77-
mv fd_lib "${{ matrix.os }}/"
77+
cp -r fd_lib "${{ matrix.os }}/"
78+
79+
- name: create deken packages
80+
run: |
81+
mkdir -p build
82+
for dir in fd_lib-*; do
83+
./deken package --output-dir ./build --no-sign-gpg --name fd_lib --version "${{ github.ref_name }}" "$dir"
84+
done
7885
7986
- name: upload artifact
80-
uses: actions/upload-artifact@v5
87+
uses: actions/upload-artifact@v6
8188
with:
82-
name: fd_lib-${{ matrix.os }}
83-
path: ${{ matrix.os }}/fd_lib
89+
name: "fd_lib-${{ github.ref_name }}-build"
90+
path: ./build
91+
if-no-files-found: error
92+
compression-level: 0
8493

8594
publish:
8695
runs-on: ubuntu-latest
8796
needs: build
88-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
97+
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
8998

9099
steps:
91-
- name: download all artifacts
92-
uses: actions/download-artifact@v5
93-
94-
- name: install deken
95-
run: |
96-
curl -L https://raw.githubusercontent.com/pure-data/deken/main/developer/deken -o deken
97-
chmod +x deken
98-
99-
- name: list files
100-
run: ls -R
100+
- name: setup deken
101+
uses: ./.github/actions/setup-deken
101102

102-
- name: import gpg key
103-
run: |
104-
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
105-
106-
# trust the key (required in CI)
107-
KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec/ {print $5; exit}')
108-
echo "5\ny\n" | gpg --command-fd 0 --batch --yes --edit-key $KEY_ID trust
109-
env:
110-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
111-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
112-
113-
- name: configure gpg
114-
run: |
115-
mkdir -p ~/.gnupg
116-
chmod 700 ~/.gnupg
117-
echo "use-agent" >> ~/.gnupg/gpg.conf
118-
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
119-
120-
- name: package all
121-
run: |
122-
for dir in fd_lib-*; do
123-
./deken package --version "${GITHUB_REF_NAME:-main}" "$dir"
124-
done
103+
- name: download all artifacts
104+
uses: actions/download-artifact@v8
105+
with:
106+
skip-decompress: true
125107

126108
- name: upload all to deken
127109
env:
128110
deken_username: ${{ secrets.DEKEN_USERNAME }}
129111
deken_password: ${{ secrets.DEKEN_PASSWORD }}
130-
run: ./deken upload *.dek
112+
run: ./deken upload **/*.dek

0 commit comments

Comments
 (0)