Repository navigation
67 lines (59 loc) · 2.03 KB
/
Copy pathrelease.yml
File metadata and controls
67 lines (59 loc) · 2.03 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
name: Release
on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: "tag name (semver without v-prefix)"
required: true
type: string
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
semver:
runs-on: "ubuntu-latest"
steps:
- name: Semver
id: semver
uses: actions/github-script@v7
with:
script: |
const tag = "${{ github.event.inputs.tag }}" || "${{ github.event.release.tag_name }}";
console.log(`Tag: ${tag}`);
const r = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
if (!r.test(tag)) {
core.setFailed(`Action failed with an invalid semver.`);
}
core.setOutput('SEMVER', tag);
outputs:
SEMVER: ${{ steps.semver.outputs.SEMVER }}
build:
needs: ["semver"]
strategy:
matrix:
version: ["14", "15", "16", "17", "18"]
arch: ["x86_64", "aarch64"]
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: "-Dwarnings"
SEMVER: ${{ needs.semver.outputs.SEMVER }}
VERSION: ${{ matrix.version }}
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Environment
run: ./tools/setup.sh ${{ matrix.version }}
- name: Build
run: ./tools/package.sh
- name: Upload Artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload --clobber $SEMVER ./build/postgresql-${VERSION}-pg-tokenizer_${SEMVER}-1_${PLATFORM}.deb
gh release upload --clobber $SEMVER ./build/postgresql-${VERSION}-pg-tokenizer_${SEMVER}_${ARCH}-linux-gnu.zip