-
Notifications
You must be signed in to change notification settings - Fork 9
110 lines (101 loc) · 3.28 KB
/
release.yaml
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
name: release
on:
workflow_dispatch:
inputs:
version:
description: Version to release (ex. `0.1.0`)
required: false
type: string
push:
branches:
# Run on all commits to main, because GitHub somehow doesn't support only specifying tag patterns
# (filtering must be done at the per-job level with an `if`)
- main
# Run on auto-generated release PRs
- prep-release-v[0-9]+\.[0-9]+\.[0-9]+
tags:
# Run on released tags (created by automated post-merge release-tagging), to generate the actual release
- v[0-9]+\.[0-9]+\.[0-9]+
jobs:
build-rpm:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/prep-release-v') }}
strategy:
matrix:
config:
- pgrx:
pg-version: pg15
pg:
version: "15.8"
- pgrx:
pg-version: pg16
pg:
version: "16.4"
- pgrx:
pg-version: pg17
pg:
version: "17.0"
steps:
- uses: actions/checkout@v3
- name: Build the RPM (reuse workflow)
uses: ./.github/workflows/build-rpm
with:
artifact-upload: true
pgrx-pg-version: ${{ matrix.config.pgrx.pg-version }}
pg-version: ${{ matrix.config.pg.version }}
build-zip-gnu:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/prep-release-v') }}
container:
image: ghcr.io/vadosware/pg_idkit/builder-gnu:0.1.x
strategy:
matrix:
config:
- pgrx:
pg-version: pg15
pg:
version: "15.8"
- pgrx:
pg-version: pg16
pg:
version: "16.4"
- pgrx:
pg-version: pg17
pg:
version: "17.0"
steps:
- uses: actions/checkout@v3
- name: Build the package (reuse workflow)
uses: ./.github/workflows/build-and-test-gnu
with:
artifact-upload: true
artifact-tarball-suffix: "-${{ matrix.config.pgrx.pg-version }}-gnu"
pgrx-pg-version: ${{ matrix.config.pgrx.pg-version }}
pg-version: ${{ matrix.config.pg.version }}
release:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/prep-release-v') }}
permissions:
contents: write
needs:
- build-rpm
- build-zip-gnu
steps:
# Checkout the repository
- uses: actions/checkout@v3
# Download all artifacts
- uses: actions/download-artifact@v3
with:
path: artifacts
# Create release (pre-release if we're prepping)
- name: Create release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ startsWith(github.ref, 'refs/heads/prep-release') }}
draft: ${{ startsWith(github.ref, 'refs/heads/prep-release') }}
tag_name: ${{ github.ref || inputs.version }}
# NOTE: while we have the CHANGELOG file, it always contains *all* changes,
# so we will use the generated GitHub commits for now
generate_release_notes: true
files: |
./artifacts/*/*