diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6b7667..bb6637e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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 diff --git a/META.json.in b/META.json.in index 77a641f..7c32bfe 100644 --- a/META.json.in +++ b/META.json.in @@ -7,7 +7,7 @@ "David E. Wheeler ", "Tembo " ], - "license": "MIT", + "license": "mit", "provides": { "jsonschema": { "abstract": "JSON Schema validation functions for PostgreSQL", @@ -19,7 +19,7 @@ "prereqs": { "runtime": { "requires": { - "PostgreSQL": "11" + "PostgreSQL": "11.0.0" } } }, diff --git a/Makefile b/Makefile index b5993e9..b88034d 100644 --- a/Makefile +++ b/Makefile @@ -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