refactor: release workflow
parent
056a24c247
commit
7bf8076a04
|
@ -84,13 +84,9 @@ jobs:
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ./
|
path: ./
|
||||||
release:
|
release:
|
||||||
environment:
|
|
||||||
CI: circleci
|
|
||||||
docker:
|
docker:
|
||||||
- image: golang:1.16
|
- image: golang:1.16
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
|
||||||
at: ~/project
|
|
||||||
- run:
|
- run:
|
||||||
name: "Ensure GnuPG is available"
|
name: "Ensure GnuPG is available"
|
||||||
command: gpg --version
|
command: gpg --version
|
||||||
|
@ -109,8 +105,6 @@ jobs:
|
||||||
- image: cimg/base:2020.01
|
- image: cimg/base:2020.01
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- attach_workspace:
|
|
||||||
at: ~/project
|
|
||||||
# Add ssh private key to allow access to AUR repository
|
# Add ssh private key to allow access to AUR repository
|
||||||
# This key is bound to user cloudskiff on AUR
|
# This key is bound to user cloudskiff on AUR
|
||||||
- add_ssh_keys:
|
- add_ssh_keys:
|
||||||
|
|
|
@ -10,14 +10,14 @@ if ! which goreleaser >/dev/null; then
|
||||||
go install github.com/goreleaser/goreleaser@v0.173.2
|
go install github.com/goreleaser/goreleaser@v0.173.2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check configuration
|
|
||||||
goreleaser check
|
|
||||||
|
|
||||||
if [ -z $ENV ]; then
|
if [ -z $ENV ]; then
|
||||||
echo "Error: ENV variable must be defined"
|
echo "Error: ENV variable must be defined"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check configuration
|
||||||
|
goreleaser check
|
||||||
|
|
||||||
if [ "$ENV" == "dev" ]; then
|
if [ "$ENV" == "dev" ]; then
|
||||||
echo "+ Building using goreleaser ..."
|
echo "+ Building using goreleaser ..."
|
||||||
goreleaser build \
|
goreleaser build \
|
||||||
|
@ -30,17 +30,13 @@ fi
|
||||||
|
|
||||||
GRFLAGS=""
|
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
|
# 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+="--snapshot "
|
||||||
GRFLAGS+="--skip-announce "
|
GRFLAGS+="--skip-announce "
|
||||||
GRFLAGS+="--skip-publish "
|
GRFLAGS+="--skip-publish "
|
||||||
|
GRFLAGS+="--skip-sign "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ${GRFLAGS}
|
echo ${GRFLAGS}
|
||||||
|
|
Loading…
Reference in New Issue