Skip to content

Commit

Permalink
release: pg_idkit 0.2.0
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
t3hmrman committed Dec 18, 2023
1 parent e92d22d commit 040aad4
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Explain the issue you have encountered while using `pg_idkit`. Under what condit
| Context | Value |
|--------------------|---------------|
| Postgres version | (ex. `14.5`) |
| `pg_idkit` version | (ex. `0.1.0`) |
| `pg_idkit` version | (ex. `0.2.0`) |

Please explain as much context as possible around the bug in addition to the information above.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ inputs:
default: false
description: |
Desired artifact name (will replace the natural name)
artifact-tarball-suffix:
type: string
default: "gnu"
description: |
Suffix that will be used on the tarball artifact (ex. '-gnu')
rust-container-version:
type: string
default: 1.73
Expand Down Expand Up @@ -35,6 +40,16 @@ inputs:
user:
type: string
default: idkit
pgrx-version:
type: string
default: pg16
decription: |
PGRX version (ex. 'pg15', 'pg16')
pg-version:
type: string
default: 16.1
decription: |
Postgres version (ex. '15.5, '16.1')
outputs: {}
runs:
using: "composite"
Expand Down Expand Up @@ -101,14 +116,16 @@ runs:
if: ${{ inputs.artifact-upload }}
shell: bash
env:
CARGO_HOME: ${{ inputs.cargo-home-dir }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
CARGO_BUILD_RUSTC_WRAPPER: ${{ inputs.cargo-build-rustc-wrapper }}
CARGO_HOME: ${{ inputs.cargo-home-dir }}
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
USER: ${{ inputs.user }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
su idkit -c "cargo install --force cargo-get cargo-edit"
Expand All @@ -125,7 +142,9 @@ runs:
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
Expand All @@ -140,7 +159,9 @@ runs:
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
Expand All @@ -155,7 +176,9 @@ runs:
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
Expand All @@ -165,12 +188,14 @@ runs:
- name: Run cargo test
shell: bash
env:
CARGO_HOME: ${{ inputs.cargo-home-dir }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
CARGO_BUILD_RUSTC_WRAPPER: ${{ inputs.cargo-build-rustc-wrapper }}
CARGO_HOME: ${{ inputs.cargo-home-dir }}
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
su idkit -c "cargo test"
Expand All @@ -189,7 +214,10 @@ runs:
CARGO_INCREMENTAL: ${{ inputs.cargo-env-incrmental }}
CARGO_PROFILE: ${{ inputs.cargo-profile }}
CARGO_TARGET_DIR: ${{ inputs.cargo-target-dir }}
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PGRX_PKG_PATH_PREFIX: ${{ inputs.cargo-target-dir }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
PKG_TARBALL_SUFFIX: ${{ inputs.artifact-tarball-suffix }}
SCCACHE_DIR: ${{ inputs.sccache-dir }}
USER: ${{ inputs.user }}
run: |
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/build-rpm/action.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-rpm
name: build-rpm
description: Build an RPM for pg_idkit
inputs:
artifact-upload:
Expand All @@ -24,6 +24,11 @@ inputs:
default: pg16
decription: |
PGRX version (ex. 'pg15', 'pg16')
pg-version:
type: string
default: 16.1
decription: |
Postgres version (ex. '15.5, '16.1')
outputs: {}
runs:
using: "composite"
Expand All @@ -47,16 +52,25 @@ runs:

- name: Initialize cargo-pgrx
shell: bash
env:
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
run: |
[[ -d /home/runner/.pgrx ]] || cargo pgrx init
- name: Build RPM
shell: bash
env:
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
run: just package build-rpm

- name: Get RPM output path
id: rpm-output
shell: bash
env:
PGRX_PG_VERSION: ${{ inputs.pgrx-version }}
PKG_PG_VERSION: ${{ inputs.pg-version }}
run: |
echo path=$(just print-rpm-output-path) >> $GITHUB_OUTPUT
echo filename=$(just print-rpm-output-file-name) >> $GITHUB_OUTPUT
Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,60 @@ on:
jobs:
build-rpm:
runs-on: ubuntu-latest
strategy:
matrix:
config:
- pgrx:
version: pg15
pg:
version: 15.5
- pgrx:
version: pg16
pg:
version: 16.1
steps:
- uses: actions/checkout@v3

- name: Build the RPM (reuse workflow)
uses: ./.github/workflows/build-rpm
with:
artifact-upload: true
pgrx-version: ${{ matrix.config.pgrx.version }}
pg-version: ${{ matrix.config.pg.version }}

build-zip:
build-zip-gnu:
runs-on: ubuntu-latest
container:
image: ghcr.io/vadosware/pg_idkit/builder:0.1.x
image: ghcr.io/vadosware/pg_idkit/builder-gnu:0.1.x
strategy:
matrix:
config:
- pgrx:
version: pg15
pg:
version: 15.5
- pgrx:
version: pg16
pg:
version: 16.1
steps:
- uses: actions/checkout@v3

- name: Build the package (reuse workflow)
uses: ./.github/workflows/build-and-test
uses: ./.github/workflows/build-and-test-gnu
with:
artifact-upload: true
artifact-tarball-suffix: "-${{ matrix.config.pgrx.version }}-gnu"
pgrx-version: ${{ matrix.config.pgrx.version }}
pg-version: ${{ matrix.config.pg.version }}

release:
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- build-rpm
- build-zip
- build-zip-gnu
steps:
# Checkout the repository
- uses: actions/checkout@v3
Expand All @@ -52,9 +79,10 @@ jobs:
- name: Create release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG
prerelease: ${{ startsWith(github.ref, 'refs/heads/prep-release') }}
draft: true
# 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/*/*
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- uses: actions/checkout@v3

- name: Build & test the project
uses: ./.github/workflows/build-and-test
uses: ./.github/workflows/build-and-test-gnu
15 changes: 15 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.2.0] - 2023-12-12

### Bug Fixes

- Test workflow matrix
- Dockerfile creation
- Dockerfile path for pg_idkit build
- Build & test args
- Run in container for basic testing
- Add GNU coreutils to base-pkg image

### Features

- Support pg16

## [0.1.0] - 2023-12-09

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pg_idkit"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
authors = ["Victor Adossi <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -65,7 +65,7 @@ assets = []
[package.metadata.generate-rpm.variants.pg11]
assets = [
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.1.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.1.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" },
]
requires = { postgresql-server = "> 11", glibc = "*" }
Expand All @@ -74,7 +74,7 @@ release = "pg11"
[package.metadata.generate-rpm.variants.pg12]
assets = [
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.1.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.1.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" },
]
requires = { postgresql-server = "> 12", glibc = "*" }
Expand All @@ -83,7 +83,7 @@ release = "pg12"
[package.metadata.generate-rpm.variants.pg13]
assets = [
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.1.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.1.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" },
]
requires = { postgresql-server = "> 13", glibc = "*" }
Expand All @@ -92,7 +92,7 @@ release = "pg13"
[package.metadata.generate-rpm.variants.pg14]
assets = [
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.1.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.1.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" },
]
requires = { postgresql-server = "> 14", glibc = "*" }
Expand All @@ -101,7 +101,7 @@ release = "pg14"
[package.metadata.generate-rpm.variants.pg15]
assets = [
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.1.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.1.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" },
]
requires = { postgresql-server = "> 15", glibc = "*" }
Expand All @@ -110,8 +110,8 @@ release = "pg15"
[package.metadata.generate-rpm.variants.pg16]
assets = [
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/lib/postgresql/pg_idkit.so", dest = "/usr/lib64/pgsql/pg_idkit.so", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.1.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.1.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit--0.2.0.sql", dest = "/usr/share/pgsql/extension/pg_idkit--0.2.0.sql", mode = "755" },
{ source = "/tmp/pg_idkit/rpm/scratch/pgrx-install/share/postgresql/extension/pg_idkit.control", dest = "/usr/share/pgsql/extension/pg_idkit.control", mode = "755" },
]
requires = { postgresql-server = "> 15", glibc = "*" }
requires = { postgresql-server = "> 16", glibc = "*" }
release = "pg16"
Loading

0 comments on commit 040aad4

Please sign in to comment.