File tree Expand file tree Collapse file tree 3 files changed +39
-6
lines changed
Expand file tree Collapse file tree 3 files changed +39
-6
lines changed Original file line number Diff line number Diff line change 1+ set -e
2+
3+ # Fail if build number not set
4+ if [ -z " $BUILD_NUMBER " ]; then
5+ echo " Env var 'BUILD_NUMBER' must be set for this script to work correctly"
6+ exit 1
7+ fi
8+
9+ # If running inside CI login to docker
10+ if [ -z ${IS_CI} ]; then
11+ echo " Not running in CI, skipping CI setup"
12+ else
13+ if [ -z $IS_PR ] && [[ $BRANCH == " refs/heads/master" ]]; then
14+ echo " On master setting PUBLISH=true"
15+ export PUBLISH=true
16+ else
17+ echo " Skipping publish as is from PR: $PR_NUMBER or not 'refs/heads/master' BRANCH: $BRANCH "
18+ fi
19+ fi
20+
21+
22+ if [ -z ${PUBLISH} ]; then
23+ echo " Running with --skip-publish as PUBLISH not set"
24+ goreleaser --skip-publish --rm-dist
25+ else
26+ echo " Publishing release"
27+ goreleaser
28+ fi
Original file line number Diff line number Diff line change 1- name : build
1+ name : build-and-release
22
33on :
44 push :
1919 - name : Build devcontainer for tooling
2020 run : sudo -E make devcontainer
2121
22- - name : Run the build
23- run : sudo -E make devcontainer-build
22+ - name : Run the release
23+ run : sudo -E make devcontainer-release
24+ env :
25+ GITHUB_TOKEN : ${{ secrets.GHACTIONS_SECRET }}
26+ BUILD_NUMBER : ${{ github.run_id }}
27+ IS_CI : 1
28+ IS_PR : ${{ github.head_ref }}
29+ BRANCH : ${{ github.ref }}
Original file line number Diff line number Diff line change 44devcontainer :
55 docker build -f ./.devcontainer/Dockerfile ./.devcontainer -t devcontainer-cli
66
7-
8- devcontainer-build :
7+ devcontainer-release :
98ifdef DEVCONTAINER
109 $(error This target can only be run outside of the devcontainer as it mounts files and this fails within a devcontainer. Don't worry all it needs is docker)
1110endif
1211 @docker run -v ${PWD}:${PWD} \
1312 --entrypoint /bin/bash \
1413 --workdir "${PWD}" \
1514 devcontainer-cli \
16- -c "make build "
15+ -c "${PWD}/scripts/ci_release.sh "
You can’t perform that action at this time.
0 commit comments