Skip to content

Commit

Permalink
Prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Apr 5, 2024
1 parent 55f47ad commit b745f56
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
46 changes: 24 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Release
name: 🚀 Bundle and Release
on:
push:
tags: [v*]
# Release on semantic version tag.
# tags: ['v[0-9]+.[0-9]+.[0-9]+']
jobs:
release:
name: Release on GitHub and PGXN
name: 🚀 Release on PGXN and GitHub
runs-on: ubuntu-latest
container: pgxn/pgxn-tools
env:
Expand All @@ -13,25 +14,26 @@ jobs:
PGXN_PASSWORD: ${{ secrets.PGXN_PASSWORD }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Bundle the Release
id: bundle
run: pgxn-bundle
env: { GIT_BUNDLE_OPTS: --add-file META.json }
run: make META.json && pgxn-bundle
- name: Release on PGXN
run: pgxn-release
- name: Generate Release Changes
run: make latest-changes.md
- name: Create GitHub Release
id: release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: latest-changes.md
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./${{ steps.bundle.outputs.bundle }}
asset_name: ${{ steps.bundle.outputs.bundle }}
asset_content_type: application/zip
run: ls -lah # pgxn-release
# - name: Generate Release Changes
# run: make latest-changes.md
# - name: Create GitHub Release
# id: release
# uses: actions/create-release@v1
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body_path: latest-changes.md
# - name: Upload Release Asset
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.release.outputs.upload_url }}
# asset_path: ./${{ steps.bundle.outputs.bundle }}
# asset_name: ${{ steps.bundle.outputs.bundle }}
# asset_content_type: application/zip
4 changes: 2 additions & 2 deletions META.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"David E. Wheeler <david@justatheory.com>",
"Tembo <admin+pgxn@tembo.io>"
],
"license": "MIT",
"license": "mit",
"provides": {
"jsonschema": {
"abstract": "JSON Schema validation functions for PostgreSQL",
Expand All @@ -19,7 +19,7 @@
"prereqs": {
"runtime": {
"requires": {
"PostgreSQL": "11"
"PostgreSQL": "11.0.0"
}
}
},
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ pgrx-version:
pg-version: Cargo.toml
@echo $(PGV)

## cleaan: Remove build artifacts and intermediate files.
## clean: Remove build artifacts and intermediate files.
clean: target
@cargo clean
@rm -rf META.json $(DISTNAME)-$(DISTVERSION).zip

# Create the PGXN META.json file.
META.json: META.json.in Cargo.toml
@sed "s/@CARGO_VERSION@/$(DISTVERSION)/g" $< > $@

# Create a PGXN-compatible zip file.
$(DISTNAME)-$(DISTVERSION).zip: META.json
git archive --format zip --prefix $(DISTNAME)-$(DISTVERSION)/ --add-file $< -o $(DISTNAME)-$(DISTVERSION).zip HEAD

## pgxn-zip: Create a PGXN-compatible zip file.
pgxn-zip: $(DISTNAME)-$(DISTVERSION).zip

0 comments on commit b745f56

Please sign in to comment.