Skip to content

fix(ci): fix refname used for release #75

fix(ci): fix refname used for release

fix(ci): fix refname used for release #75

Workflow file for this run

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@v4
- 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@v4
- 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@v4
# 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_name || 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/*/*