Skip to content

Commit

Permalink
remove github_release target
Browse files Browse the repository at this point in the history
  • Loading branch information
linyows committed Jan 14, 2025
1 parent 609f565 commit 8e63fad
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ BINDIR=$(PREFIX)/bin
BUILD=tmp/libs
CACHE=/var/cache/octopass

DIST ?= $(shell grep VERSION_CODENAME /etc/os-release | awk -F '=' '{print $$2}' ORS='')
DIST_CODENAME := $(shell grep VERSION_CODENAME /etc/os-release | awk -F '=' '{print $$2}' ORS='')
DIST_ID := $(shell grep '^ID=' /etc/os-release | awk -F '=' '{print $$2}' ORS='')
DIST ?= $(DIST_ID)-$(DIST_CODENAME)

SOURCES_RPM=Makefile octopass.h octopass*.c nss_octopass*.c octopass.conf.example COPYING selinux/octopass.pp
SOURCES=Makefile octopass.h octopass*.c nss_octopass*.c octopass.conf.example COPYING
VERSION=$(shell awk -F\" '/^\#define OCTOPASS_VERSION / { print $$2; exit }' octopass.h)
Expand Down Expand Up @@ -170,25 +173,19 @@ deb: source_for_deb ## Packaging for DEB
cp *.deb ../builds
rm -rf tmp.$(DIST)

deps_for_dist:
go install github.com/tcnksm/ghr@latest
go install github.com/mlafeldt/pkgcloud/cmd/pkgcloud-push@latest

github_release: ## Upload archives to Github Release
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Releasing for Github$(RESET)"
rm -rf builds/.keep && ghr v$(VERSION) builds && git checkout builds/.keep

packagecloud_release: ## Upload archives to PackageCloud
packagecloud: ## Upload archives to PackageCloud
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Releasing for PackageCloud$(RESET)"
pkgcloud-push linyows/octopass/ubuntu/focal builds/octopass_$(VERSION)-1_amd64.focal.deb
pkgcloud-push linyows/octopass/debian/bullseye builds/octopass_$(VERSION)-1_amd64.bullseye.deb
curl -X POST \
-F "package[distro_version]=$(DIST_ID)/$(DIST_CODENAME)" \
-F "package[package_file]=@octopass_$(VERSION)_amd64.$(DIST).deb" \
-H "Authorization: Bearer $(PACKAGECLOUD_TOKEN)" \
https://packagecloud.io/api/v1/repos/linyows/octopass/packages.json

pkg: clean ## Create some distribution packages
docker-compose up

dist: ## Upload archives to GitHub and PackageCloud
@test -z $(GITHUB_TOKEN) || $(MAKE) github_release
@test -z $(PACKAGECLOUD_TOKEN) || $(MAKE) packagecloud_release
@test -z $(PACKAGECLOUD_TOKEN) || $(MAKE) packagecloud

clean: ## Delete tmp directory
@echo "$(INFO_COLOR)==> $(RESET)$(BOLD)Cleaning$(RESET)"
Expand Down

0 comments on commit 8e63fad

Please sign in to comment.