age icon indicating copy to clipboard operation
age copied to clipboard

Add PGXN release workflow

Open theory opened this issue 3 months ago • 11 comments

It's triggered by a semver tag. I don't see any tags on this repo, but do notice that the version on PGXN appears to be a couple versions back. Use this workflow if you'd like to automate its release; change the on triggers to trigger a release by some other means.

Be sure to add workflow secrets to this project named PGXN_USERNAME and PGXN_PASSWORD to allow it to authenticate to publish the extension.

Other stuff:

  • Add .gitattributes so that the contents of .github and .git are excluded from the exported archive
  • Fix the extension name in the META.json file to the actual extension name (same as the control file name)
  • Updated the version in the META.json and shortened the abstract and description a bit (otherwise they take up a lot of space on the PGXN page.
  • Read the versions from the META.json file and set the extension name from MODULE_big.
  • Add a dist make target to produce a zip file to manually upload to PGXN.

theory avatar Mar 22 '24 19:03 theory

Hi @rafsun42 ... Can you look into this PR?

aked21 avatar Mar 29 '24 09:03 aked21

@aked21 Sure, I am reviewing it.

rafsun42 avatar Apr 03 '24 19:04 rafsun42

Hi @rafsun42, can this get merged?

aked21 avatar Apr 10 '24 05:04 aked21

@theory Hello. Is this PR tested?

rafsun42 avatar Apr 18 '24 17:04 rafsun42

I am a bit weary of modifications to the Makefile. Why are those modifications necessary? Especially, if someone could modify the META.json file and impact the Makefile builds.

jrgemignani avatar Apr 18 '24 17:04 jrgemignani

Yes, I tested it with the exception of actually releasing it. See this build.

The changes to the Makefile are no strictly speaking required; I thought it useful to demonstrate how to use it to set the version in one place. pgrx projects often read the version from a Cargo.toml file, but many PGXS-based projects use the META.json file. The dist target is not required, but handy to manually check that that the PGXN zip file is generated properly.

We could probably remove it all if you'd like; the pgxn-bundle command used in the release workflow does pretty much the same thing, depending on the META.json file to read the version.

theory avatar Apr 18 '24 17:04 theory

@theory My preference, for now, is to not touch the Makefile. I do get what you're trying to do, though, and it is appreciated.

jrgemignani avatar Apr 18 '24 18:04 jrgemignani

Okay, removed the Makefile changes in 969842b.

theory avatar Apr 18 '24 19:04 theory

@theory

Be sure to add workflow secrets to this project named PGXN_USERNAME and PGXN_PASSWORD to allow it to authenticate to publish the extension.

I'm not sure what or where to add this information.

jrgemignani avatar Apr 19 '24 18:04 jrgemignani

I'm not sure what or where to add this information.

Presumably you have access to the PGXN username and password, since Apache Age is on PGXN already. What you need to do is go to https://github.com/apache/age/settings/secrets/actions and add two repository secrets, one named PGXN_USERNAME and the other PGXN_PASSWORD. These will then be injected into the GitHub workflow and used to authenticate to PGXN and publish the release.

theory avatar Apr 19 '24 18:04 theory

@theory Unfortunately, I don't have access to that. We will need to find out who does before moving forward and merging this.

jrgemignani avatar Apr 19 '24 19:04 jrgemignani