<?xml version="1.0" encoding="UTF-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><id>https://blog.pgxn.org/tags/github-workflows/</id><title>GitHub Workflows</title><updated>2024-01-31T16:52:19Z</updated><link rel="self" type="application/atom+xml" href="https://blog.pgxn.org/tags/github-workflows/feed.xml"/><link rel="alternate" type="text/html" href="https://blog.pgxn.org/tags/github-workflows/"/><author><name>The PGXN Maintainers</name></author><generator uri="https://gohugo.io/" version="0.167.0">Hugo</generator><entry><id>https://blog.pgxn.org/post/741049567045468160</id><title type="html">PGXN Tools Docker Image Updated</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2024/pgxn-tools-v4/"/><updated>2026-10-07T16:13:48Z</updated><published>2024-01-31T16:52:19Z</published><author><name>David E. Wheeler</name></author><category scheme="https://blog.pgxn.org/tags" term="pgxn" label="PGXN"/><category scheme="https://blog.pgxn.org/tags" term="docker" label="Docker"/><category scheme="https://blog.pgxn.org/tags" term="github-actions" label="GitHub Actions"/><category scheme="https://blog.pgxn.org/tags" term="github-workflows" label="GitHub Workflows"/><category scheme="https://blog.pgxn.org/tags" term="release" label="Release"/><category scheme="https://blog.pgxn.org/tags" term="bundle" label="Bundle"/><summary type="html"><![CDATA[<p>Just a quick note to highlight some bug fixes and improvements in the
<a href="https://github.com/pgxn/docker-pgxn-tools/">pgxn/pgxn-tools Docker image</a> in the last few weeks.</p>
<p>v1.4.0 adds the <code>GIT_BUNDLE_OPTS</code> and <code>ZIP_BUNDLE_OPTS</code> environment variables.
The former is passed to <code>git archive</code> and the latter to zip, and let
additional options be passed to those commands. For example, the <a href="https://pgxn.org/dist/vectorize/">vectorize
extension</a>&rsquo;s <a href="https://github.com/tembo-io/pg_vectorize/blob/v0.9.0/.github/workflows/pgxn-release.yml">release workflow</a> sets <code>GIT_BUNDLE_OPTS: --add-file META.json</code>
because git archive archives only checked-in files, and <code>META.json</code> is not
checked in but <a href="https://github.com/tembo-io/pg_vectorize/blob/v0.9.0/Makefile#L17-L18">generated from</a> <code>META.json.in</code>.</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>Just a quick note to highlight some bug fixes and improvements in the
<a href="https://github.com/pgxn/docker-pgxn-tools/">pgxn/pgxn-tools Docker image</a> in the last few weeks.</p>
<p>v1.4.0 adds the <code>GIT_BUNDLE_OPTS</code> and <code>ZIP_BUNDLE_OPTS</code> environment variables.
The former is passed to <code>git archive</code> and the latter to zip, and let
additional options be passed to those commands. For example, the <a href="https://pgxn.org/dist/vectorize/">vectorize
extension</a>&rsquo;s <a href="https://github.com/tembo-io/pg_vectorize/blob/v0.9.0/.github/workflows/pgxn-release.yml">release workflow</a> sets <code>GIT_BUNDLE_OPTS: --add-file META.json</code>
because git archive archives only checked-in files, and <code>META.json</code> is not
checked in but <a href="https://github.com/tembo-io/pg_vectorize/blob/v0.9.0/Makefile#L17-L18">generated from</a> <code>META.json.in</code>.</p>
<p>v1.4.1 <a href="https://github.com/pgxn/docker-pgxn-tools/commit/1114aed">fixes an issue</a> where <code>git archive</code> was never actually used to build a
release zip archive. This changed at some point without noticing due to the
introduction of the <code>safe.directory</code> configuration in recent versions of Git.
Inside the container the directory was never trusted, and the <code>pgxn-bundle</code>
command caught the error, decided it wasn&rsquo;t working with a Git repository, and
used the <code>zip</code> command, instead.</p>
<p>As a result, a number of recent releases have included files they shouldn&rsquo;t,
such as the contents of the <code>.git</code> directory. <a href="https://github.com/pgxn/docker-pgxn-tools/commit/1114aed">The fix</a>
<a href="https://stackoverflow.com/a/73100228/79202">disables</a> <code>safe.directory</code> so that the repository directory is always trusted
inside the container, as needed in GitHub actions.</p>
<p>If you use <code>pgxn-bundle</code> in a GitHub workflow, be aware that recent releases
(since November 2021 at least) include stuff that it should not, including the
<code>.git</code> directory (here&rsquo;s <a href="https://gist.github.com/theory/93c93571200aad02e93170c6d2c93cbe">a list</a>) and patterns excluded in <code>.gitattributes</code>.
Your next release should be cleaner.</p>
<p>v1.4.1 also allows the setting of the <code>PROFILE</code> environment variable, so that
the default <code>PROFILE=--Werror</code> can be overridden.</p>
<p>v1.4.2 adds (and v1.4.3 improves, see below) <code>git-archive-all</code> to the image,
and the <code>GIT_ARCHIVE_CMD</code> environment variable to tell <code>pgxn-bundle</code> which archive
command to use, either <code>archive</code> or <code>archive-all</code>. The latter is useful for
repositories that use Git submodules and need to include their contents in the
release, as demonstrated in <a href="https://github.com/plv8/plv8/pull/570/files#diff-4e4745c3f39dff4c307faf79bfa1242cc5ba2eb5947bebdcddc8d97eeb40685fR15">this plv8 pull request</a>.</p>
<p>v1.4.2 also adds <a href="https://cmake.org/"><code>cmake</code></a> and the <code>libarchive-tools</code> package to the image.
The latter bundles in <a href="https://libarchive.org/">libarchive</a> tools like <code>bsdtar</code> and <code>bsdcpio</code>, which
might be useful for editing Zip files in place.</p>
<p>v1.4.3 passes the <code>--force-submodules</code> option to <code>git-archive-all</code>, because
otherwise submodules weren&rsquo;t included in the bundle.</p>
<p>All of this should just start showing up in your GitHub workflows as long as
they use <code>container: pgxn/pgxn-tools</code> or <code>container: pgxn/pgxn-tools@v1</code>.</p>
<p>Questions? Post em in the <a href="https://postgresteam.slack.com/archives/C056ZA93H1A">#extensions</a> channel on the <a href="https://pgtreats.info/slack-invite">Postgres Slack</a> or to
the attention of the <a href="https://mastodon.social/@pgxn">PGXN Mastodon bot</a>.</p>
]]></content></entry></feed>