diff --git a/.gitattributes b/.gitattributes index d1a12b2..a1377a2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ .gitignore export-ignore .gitattributes export-ignore .github export-ignore -*.bak export-ignore +META.json export-ignore diff --git a/.github/workflows/pgxn-release.yml b/.github/workflows/pgxn-release.yml index 534c80e..d6e59bb 100644 --- a/.github/workflows/pgxn-release.yml +++ b/.github/workflows/pgxn-release.yml @@ -12,7 +12,8 @@ jobs: - name: Check out the repo uses: actions/checkout@v4 - name: Bundle the Release - run: make META.json.bak && pgxn-bundle + env: { GIT_BUNDLE_OPTS: --add-file META.json } + run: make META.json && pgxn-bundle - name: Release on PGXN env: PGXN_USERNAME: ${{ secrets.PGXN_USERNAME }} diff --git a/.gitignore b/.gitignore index 52144ee..a8ea3e0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ **/*.rs.bk .env .trunk -*.bak +META.json diff --git a/META.json b/META.json.in similarity index 100% rename from META.json rename to META.json.in diff --git a/Makefile b/Makefile index 281c91a..3219508 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +DISTNAME = $(shell grep -m 1 '^name' Trunk.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/') DISTVERSION = $(shell grep -m 1 '^version' Cargo.toml | sed -e 's/[^"]*"\([^"]*\)",\{0,1\}/\1/') format: @@ -8,9 +9,13 @@ format: run: PGLATER_SOCKET_URL='postgresql:///pg_later?host=/Users/${USER}/.pgrx&user=${USER}&dbname=pg_later&port=28815' cargo pgrx run -META.json.bak: Cargo.toml META.json - @sed -i.bak "s/@CARGO_VERSION@/$(DISTVERSION)/g" META.json +META.json: META.json.in Trunk.toml + @sed "s/@CARGO_VERSION@/$(DISTVERSION)/g" $< > $@ -pgxn-zip: META.json.bak - git archive --format zip --prefix=pg_later-$(DISTVERSION)/ -o pg_later-$(DISTVERSION).zip HEAD - @mv META.json.bak META.json +$(DISTNAME)-$(DISTVERSION).zip: META.json + git archive --format zip --prefix $(DISTNAME)-$(DISTVERSION)/ --add-file $< -o $(DISTNAME)-$(DISTVERSION).zip HEAD + +pgxn-zip: $(DISTNAME)-$(DISTVERSION).zip + +clean: + @rm -rf META.json $(DISTNAME)-$(DISTVERSION).zip