refactor: release workflow

main
sundowndev 2021-07-22 11:05:08 +02:00
parent 056a24c247
commit 7bf8076a04
2 changed files with 6 additions and 16 deletions

View File

@ -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:

View File

@ -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}