From 7bf8076a0408fe1e52cb5d072d449135da5d3e3c Mon Sep 17 00:00:00 2001 From: sundowndev Date: Thu, 22 Jul 2021 11:05:08 +0200 Subject: [PATCH] refactor: release workflow --- .circleci/config.yml | 6 ------ scripts/build.sh | 16 ++++++---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ccb877b8..98f610a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,13 +84,9 @@ jobs: - store_test_results: path: ./ release: - environment: - CI: circleci docker: - image: golang:1.16 steps: - - attach_workspace: - at: ~/project - run: name: "Ensure GnuPG is available" command: gpg --version @@ -109,8 +105,6 @@ jobs: - image: cimg/base:2020.01 steps: - checkout - - attach_workspace: - at: ~/project # Add ssh private key to allow access to AUR repository # This key is bound to user cloudskiff on AUR - add_ssh_keys: diff --git a/scripts/build.sh b/scripts/build.sh index f8c49e82..765d4399 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -10,14 +10,14 @@ if ! which goreleaser >/dev/null; then go install github.com/goreleaser/goreleaser@v0.173.2 fi -# Check configuration -goreleaser check - if [ -z $ENV ]; then echo "Error: ENV variable must be defined" exit 1 fi +# Check configuration +goreleaser check + if [ "$ENV" == "dev" ]; then echo "+ Building using goreleaser ..." goreleaser build \ @@ -30,17 +30,13 @@ fi GRFLAGS="" -# We sign every releases using PGP -# We may not want to do so in dev environments -if [ -z $SIGNINGKEY ]; then - GRFLAGS+="--skip-sign " -fi - # Only CI system should publish artifacts -if [ "$CI" != "circleci" ]; then +# We may not want to sign artifacts in dev environments +if [ "$CI" != true ]; then GRFLAGS+="--snapshot " GRFLAGS+="--skip-announce " GRFLAGS+="--skip-publish " + GRFLAGS+="--skip-sign " fi echo ${GRFLAGS}