env:
GH_TOKEN: ${{ github.token }}
run: |
- RELEASE_TAG=v$(python3 sql/latest_version.py)
- echo RELEASE_TAG=$RELEASE_TAG
- test -n "$RELEASE_TAG"
+ RELEASE_TAG=$(make deploy/get-current-db-version)
# Test that github-cli is working
gh --version
gh release list -L 1
- # TODO: enhance this to be: if release_tag > current_prod_tag, deploy
+ # TODO: enhance this to be: if release_tag > current_prod_tag, deploy.
+ # Otherwise, can skip this step entirely?
gh release view $RELEASE_TAG || echo "PUBLISH=1" >> "$GITHUB_OUTPUT"
# yamllint disable rule:line-length
./sql/build.sh ${DB_VERSION}
du -h ${DB_FILE}
+
+.PHONY: deploy/get-current-db-version
+deploy/get-current-db-version:
+ @test "${DB_VERSION}"
+ @echo v${DB_VERSION}
+
+
.PHONY: deploy/upload
deploy/upload: ## Upload to GitHub releases
test -n "${DB_VERSION}"
.PHONY: deploy/delete
deploy/delete:
+ [[ "$(shell read -e -p 'Really delete v${DB_VERSION}? [y/N]> '; echo $$REPLY)" == [Yy]* ]]
gh release delete v${DB_VERSION}
git push origin --delete v${DB_VERSION}
- git tag -d v${DB_VERSION}
REMOTE_HEAD ?= origin/master
-
-.PHONY: _check-git-up-to-date
-_check-git-up-to-date:
- git branch --show-current
- git fetch
- # Check that we are in sync with ${REMOTE_HEAD}
- git diff --quiet ${REMOTE_HEAD}
-
PROJECT_NAME ?= usda-sqlite
.PHONY: deploy/install-prod
.PHONY: check-vars
check-vars: ## display all computed vars (won't show passed in)
- $(info --vars--)
- $(foreach v, \
- $(filter-out $(FILTERED_VARS) FILTERED_VARS,$(.VARIABLES)), \
- $(info $(v) = $($(v))))
- @printf ''
+ $(foreach v, $(.VARIABLES), $(if $(filter file, $(origin $(v))), $(info $(v)=$($(v)))))
.PHONY: extras/cloc
extras/cloc: