Repository navigation
136 lines (119 loc) · 4.12 KB
/
Copy pathrelease-linux-artifacts.yml
File metadata and controls
136 lines (119 loc) · 4.12 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
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Release Linux Artifacts
on:
workflow_dispatch:
inputs:
tag:
description: "Existing release tag (for example: v0.9.14)"
required: true
type: string
workflow_call:
inputs:
tag:
description: "Existing release tag (for example: v0.9.14)"
required: true
type: string
permissions:
contents: read
jobs:
build:
name: Build ${{ matrix.arch }} artifact
runs-on: ${{ matrix.runner }}
# A normal build takes about six minutes; fail a hang instead of waiting
# for the six-hour job limit.
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
platform: linux/amd64
runner: ubuntu-latest
out_name: db_interpose_pg-linux-x86_64.so
- arch: aarch64
platform: linux/arm64
runner: ubuntu-24.04-arm
out_name: db_interpose_pg-linux-aarch64.so
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Export only the built payload (/libs). Exporting the whole builder
# rootfs (Rust toolchain, over a gigabyte) hung on the ARM64 runner
# during "copying files" for v1.3.25.
- name: Build shim payload for ${{ matrix.platform }}
run: |
set -eux
mkdir -p out/${{ matrix.arch }} dist
docker buildx build \
--platform "${{ matrix.platform }}" \
--target export-payload \
--output "type=local,dest=out/${{ matrix.arch }}" \
.
- name: Collect shim artifact
run: |
set -eux
cp "out/${{ matrix.arch }}/libs/db_interpose_pg.so" "dist/${{ matrix.out_name }}"
- name: Collect matching runtime libraries
run: |
set -eux
mkdir -p "dist/libs/${{ matrix.arch }}"
cp -L out/${{ matrix.arch }}/libs/*.so* "dist/libs/${{ matrix.arch }}/"
rm "dist/libs/${{ matrix.arch }}/db_interpose_pg.so"
test -s "dist/libs/${{ matrix.arch }}/libpq.so.5"
test -s "dist/libs/${{ matrix.arch }}/libgcc_s.so.1"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.arch }}
path: dist/
if-no-files-found: error
package-linux-zip:
name: Package Linux zip bundle
runs-on: ubuntu-latest
timeout-minutes: 15
needs: build
outputs:
tag: ${{ steps.tag.outputs.value }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- name: Determine tag
id: tag
run: |
set -eu
echo "value=${{ inputs.tag || github.ref_name }}" >> "$GITHUB_OUTPUT"
- name: Download Linux build artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
- name: Build Linux zip
run: |
set -eux
TAG="${{ steps.tag.outputs.value }}"
STAGE="linux-zip"
OUT="plex-postgresql-${TAG}-linux.zip"
rm -rf "$STAGE"
mkdir -p "$STAGE/scripts" "$STAGE/schema"
cp release-assets/linux-x86_64/db_interpose_pg-linux-x86_64.so "$STAGE/"
cp release-assets/linux-aarch64/db_interpose_pg-linux-aarch64.so "$STAGE/"
mkdir -p "$STAGE/libs"
cp -R release-assets/linux-x86_64/libs/x86_64 "$STAGE/libs/"
cp -R release-assets/linux-aarch64/libs/aarch64 "$STAGE/libs/"
cp README.md CHANGELOG.md INSTALL.md LICENSE THIRD_PARTY_LICENSES "$STAGE/"
cp -R scripts/* "$STAGE/scripts/"
cp schema/*.sql "$STAGE/schema/"
(cd "$STAGE" && zip -r "../$OUT" .)
shasum -a 256 "$OUT" > "$OUT.sha256"
- name: Upload packaged zip artifact
uses: actions/upload-artifact@v4
with:
name: linux-release-zip
path: |
plex-postgresql-*-linux.zip
plex-postgresql-*-linux.zip.sha256
if-no-files-found: error