Skip to content

Commit 1221ccd

Browse files
committed
Upload rolling-shutter/v* tags as release on github
1 parent 51fc0fc commit 1221ccd

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

.circleci/config.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ orbs:
1111
executors:
1212
cimg-base:
1313
docker:
14-
- image: cimg/base:2021.11
14+
- image: cimg/base:2022.03
1515

1616
jobs:
1717
gen:
@@ -46,6 +46,9 @@ jobs:
4646
configuration_path: continue-generated.yml
4747

4848
workflows:
49-
always:
49+
gen:
5050
jobs:
51-
- gen
51+
- gen:
52+
filters:
53+
tags:
54+
only: /^.*$/

.circleci/rolling-shutter.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,21 @@ jobs:
8787
steps:
8888
- checkout:
8989
path: ~/src
90+
- run:
91+
name: Configure environment
92+
command: |
93+
version=$(echo ${CIRCLE_TAG} | sed -e s#^rolling-shutter/##)
94+
echo >>${BASH_ENV} export VERSION="${version}"
95+
echo >>${BASH_ENV} export BIN=/tmp/release-bin
9096
- restore_cache:
9197
keys:
9298
- rs-build-go-integration-v3-{{ checksum "go.sum" }}
93-
- run: env VERSION=${CIRCLE_TAG} ./build-release
94-
- run: go install github.com/tcnksm/[email protected]
95-
- attach_workspace:
96-
at: ~/share
99+
- run: ./build-release
100+
- run: go install github.com/tcnksm/[email protected]
97101
- run:
98-
name: Upload binaries and combined.json
102+
name: Upload binaries
99103
command: |
100-
cp ~/share/combined.json bin/
101-
ghr ${CIRCLE_TAG} bin/
104+
ghr ${CIRCLE_TAG} ${BIN}
102105
103106
rs-lint:
104107
executor: go
@@ -132,14 +135,14 @@ workflows:
132135
- rs-generate:
133136
filters:
134137
tags:
135-
only: /^v\d+\.\d+\.\d+$/
138+
only: /.*/
136139
- rs-build:
137140
matrix:
138141
parameters:
139142
go-version: [go-integration]
140143
filters:
141144
tags:
142-
only: /^v\d+\.\d+\.\d+$/
145+
only: /.*/
143146
- publish-release:
144147
requires:
145148
- rs-build
@@ -149,7 +152,7 @@ workflows:
149152
branches:
150153
ignore: /.*/
151154
tags:
152-
only: /^v\d+\.\d+\.\d+$/
155+
only: /^rolling-shutter\/v\d+\.\d+\.\d+$/
153156
- rs-lint:
154157
filters:
155158
branches:

rolling-shutter/build-release

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,23 @@ set -euo pipefail
33

44
: "${GO:=go}"
55
: "${VERSION:=}"
6-
: "${TARGETS:=linux-amd64 linux-arm linux-arm64 freebsd-amd64 openbsd-amd64 darwin-amd64}"
6+
: "${TARGETS:=linux-amd64 linux-arm64 freebsd-amd64 openbsd-amd64 darwin-amd64 darwin-arm64}"
7+
: "${BIN:=bin}"
8+
9+
function remove_version_prefix() {
10+
echo "$1" | sed -e s#^rolling-shutter/##
11+
}
712

813
if [[ -z "${VERSION}" ]]; then
9-
VERSION=$(git describe --tags --always --abbrev=4 --dirty --match 'rolling-shutter/v*' | sed -e s#^rolling-shutter/##)
14+
VERSION=$(git describe --tags --always --abbrev=4 --dirty --match 'rolling-shutter/v*')
1015
fi
1116

17+
VERSION=$(remove_version_prefix "$VERSION")
18+
1219
git clean -xfd bin
1320
for osarch in ${TARGETS}; do
1421
IFS='-' read -r os arch <<< "${osarch}"
15-
target=bin/rolling-shutter-${os}-${arch}-${VERSION}
22+
target=${BIN}/rolling-shutter-${os}-${arch}-${VERSION}
1623
echo "Building ${target}"
1724
env GOARCH="${arch}" GOOS="${os}" ${GO} build -o "${target}" -ldflags "-X github.com/shutter-network/shutter/shuttermint/cmd/shversion.version=${VERSION}" .
1825
done

0 commit comments

Comments
 (0)