Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
spa5k committed Jun 8, 2024
1 parent 47a82d8 commit 3d0bd51
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ env:
NAME: uids_postgres
EXT_NAME: uids_postgres
PKG_NAME: uids_postgres

name: Release

on:
push:
tags: [v*]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
create-release:
name: Create release
Expand All @@ -19,14 +23,14 @@ jobs:
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}

build-linux-gnu:
name: Build & Release for linux
needs:
- create-release
needs: create-release
strategy:
fail-fast: false
matrix:
Expand All @@ -39,8 +43,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install rust
uses: dtolnay/rust-toolchain@1.78.0

- name: Install dependencies
run: |
# Add postgres package repo
Expand All @@ -58,12 +64,12 @@ jobs:
# Ensure installed pg_config is first on path
export PATH=$PATH:/usr/lib/postgresql/${{ matrix.postgres }}/bin
cargo install cargo-pgrx --version 0.11.2 --locked
cargo install cargo-pgrx --version 0.11.4 --locked
cargo pgrx init --pg${{ matrix.postgres }}=/usr/lib/postgresql/${{ matrix.postgres }}/bin/pg_config
- name: Build artifacts
run: |
# selects the pgVer from pg_config on path
# https://github.com/tcdi/pgrx/issues/288
cargo pgrx package --no-default-features --features pg${{ matrix.postgres }}
# Create installable package
Expand Down Expand Up @@ -107,12 +113,13 @@ jobs:
sudo chown -R root:root package
sudo chmod -R 00755 package
sudo dpkg-deb -Zxz --build --root-owner-group package
- name: Upload artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./package.deb
asset_name: ${{ env.NAME }}-${{ github.ref_name }}-pg${{ matrix.postgres }}-${{ matrix.box.arch }}-linux-gnu.deb
asset_content_type: application/vnd.debian.binary-package
asset_content_type: application/vnd.debian.binary-package
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "uids"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN \
cargo --version

# pgrx
RUN cargo install cargo-pgrx --version 0.11.2 --locked
RUN cargo install cargo-pgrx --version 0.11.4 --locked

RUN cargo pgrx init --pg${PG_MAJOR} $(which pg_config)

Expand Down

0 comments on commit 3d0bd51

Please sign in to comment.