Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bc06a6f
chore: write build_go.sh script and dependencies
deansheather Jun 7, 2022
850bc82
chore: write build_go_matrix.sh and archive.sh
deansheather Jun 8, 2022
e847230
fixup! chore: write build_go_matrix.sh and archive.sh
deansheather Jun 8, 2022
4edb649
fixup! chore: write build_go_matrix.sh and archive.sh
deansheather Jun 8, 2022
4ed419c
merge main
deansheather Jun 8, 2022
cef0221
chore: add scripts for packages
deansheather Jun 8, 2022
64f9648
chore: add scripts for building a docker image
deansheather Jun 8, 2022
998bc31
chore: add docker multi-arch script and release script
deansheather Jun 9, 2022
46b5d79
fixup! chore: add docker multi-arch script and release script
deansheather Jun 9, 2022
9e279a9
chore: fix indenting
deansheather Jun 9, 2022
4885076
chore: update makefile to use new build scripts
deansheather Jun 9, 2022
044780d
chore: update release workflow to use new build scripts
deansheather Jun 10, 2022
59cd2c7
fixup! chore: update release workflow to use new build scripts
deansheather Jun 12, 2022
d1edee5
fixup! chore: update release workflow to use new build scripts
deansheather Jun 12, 2022
4f03e37
fixup! chore: update release workflow to use new build scripts
deansheather Jun 12, 2022
5c9dd9e
fixup! chore: update release workflow to use new build scripts
deansheather Jun 12, 2022
e09edfd
fixup! chore: update release workflow to use new build scripts
deansheather Jun 13, 2022
4dd6f4d
chore: add dependency checks to release scripts
deansheather Jun 13, 2022
72d8b50
fixup! chore: add dependency checks to release scripts
deansheather Jun 13, 2022
17cda1f
fixup! chore: add dependency checks to release scripts
deansheather Jun 13, 2022
6a4bc44
fixup! chore: add dependency checks to release scripts
deansheather Jun 13, 2022
e150438
fixup! chore: add dependency checks to release scripts
deansheather Jun 13, 2022
449a1a1
chore: make dependency checks nicer
deansheather Jun 14, 2022
ba78076
fixup! chore: make dependency checks nicer
deansheather Jun 14, 2022
a19ef36
fixup! chore: make dependency checks nicer
deansheather Jun 14, 2022
94a6fcd
fixup! chore: make dependency checks nicer
deansheather Jun 14, 2022
c524507
fixup! chore: make dependency checks nicer
deansheather Jun 14, 2022
48eaa18
fixup! chore: make dependency checks nicer
deansheather Jun 14, 2022
ce3f4f5
fixup! chore: make dependency checks nicer
deansheather Jun 14, 2022
4886542
fixup! chore: make dependency checks nicer
deansheather Jun 14, 2022
d4631ad
fixup! chore: make dependency checks nicer
deansheather Jun 14, 2022
a0c9a96
chore: integrate docker into pipeline
deansheather Jun 15, 2022
0907c37
fixup! chore: integrate docker into pipeline
deansheather Jun 15, 2022
4a94e25
fixup! chore: integrate docker into pipeline
deansheather Jun 16, 2022
37badc3
Merge branch 'main' into remove-goreleaser
deansheather Jun 16, 2022
173031f
chore: add version checks to lib.sh
deansheather Jun 16, 2022
ae48f20
fixup! chore: add version checks to lib.sh
deansheather Jun 16, 2022
d8a624c
fixup! chore: add version checks to lib.sh
deansheather Jun 16, 2022
6f2b997
Merge branch 'main' into remove-goreleaser
deansheather Jun 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! chore: make dependency checks nicer
  • Loading branch information
deansheather committed Jun 14, 2022
commit c5245072394b5f8e3eea9728ec31ce0d7215000b
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
workflow_dispatch:
inputs:
snapshot:
description: Allow a +dev version to be generated, implies dry_run.
description: Force a dev version to be generated, implies dry_run.
type: boolean
required: true
dry_run:
Expand All @@ -24,6 +24,7 @@ on:
# In a non-snapshot we want the ./scripts/version.sh script to never generate a
# +dev version.
env:
CODER_FORCE_DEV_VERSION: ${{ github.event.inputs.snapshot && 'true' || 'false' }}
CODER_NO_DEV_VERSION: ${{ github.event.inputs.snapshot && 'false' || 'true' }}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This script builds a single Go binary of Coder with the given parameters.
#
# Usage: ./build_go.sh [--version 1.2.3+devel.abcdef] [--os linux] [--arch amd64] [--output path/to/output] [--slim]
# Usage: ./build_go.sh [--version 1.2.3-devel+abcdef] [--os linux] [--arch amd64] [--output path/to/output] [--slim]
#
# Defaults to linux:amd64 with slim disabled, but can be controlled with GOOS,
# GOARCH and CODER_SLIM_BUILD=1. If no version is specified, defaults to the
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_go_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This script builds multiple Go binaries for Coder with the given OS and
# architecture combinations.
#
# Usage: ./build_go_matrix.sh [--version 1.2.3+devel.abcdef] [--output dist/] [--slim] [--sign-darwin] [--archive] [--package-linux] os1:arch1,arch2 os2:arch1 os1:arch3
# Usage: ./build_go_matrix.sh [--version 1.2.3-devel+abcdef] [--output dist/] [--slim] [--sign-darwin] [--archive] [--package-linux] os1:arch1,arch2 os2:arch1 os1:arch3
#
# If no OS:arch combinations are provided, nothing will happen and no error will
# be returned. Slim builds are disabled by default. If no version is specified,
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_go_slim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This script builds multiple "slim" Go binaries for Coder with the given OS and
# architecture combinations. This wraps ./build_go_matrix.sh.
#
# Usage: ./build_go_slim.sh [--version 1.2.3+devel.abcdef] [--output dist/] os1:arch1,arch2 os2:arch1 os1:arch3
# Usage: ./build_go_slim.sh [--version 1.2.3-devel+abcdef] [--output dist/] os1:arch1,arch2 os2:arch1 os1:arch3
#
# If no OS:arch combinations are provided, nothing will happen and no error will
# be returned. If no version is specified, defaults to the version from
Expand Down
1 change: 1 addition & 0 deletions scripts/image_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ if [[ "$arch" != "" ]]; then
tag+="-$arch"
fi

# Dev versions contain plus signs which are illegal characters in Docker tags.
tag="${tag//+/-}"
echo "$image:$tag"
12 changes: 9 additions & 3 deletions scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# This script generates the version string used by Coder, including for dev
# versions. Note: the version returned by this script will NOT include the "v"
# prefix that is included in the Git tag.
#
# If $CODER_FORCE_DEV_VERSION is set to "true", the returned version will be a
# dev version even if the current commit is tagged.
#
# If $CODER_NO_DEV_VERSION is set to "true", the script will fail if the current
# commit is not tagged.

set -euo pipefail
# shellcheck source=scripts/lib.sh
Expand All @@ -17,9 +23,9 @@ version="$last_tag"

# If the HEAD has extra commits since the last tag then we are in a dev version.
#
# Dev versions are denoted by the "+dev." suffix with a trailing commit short
# Dev versions are denoted by the "-devel+" suffix with a trailing commit short
# SHA.
if [[ "$last_tag" != "$current" ]]; then
if [[ "${CODER_FORCE_DEV_VERSION:-}" == *t* ]] || [[ "$last_tag" != "$current" ]]; then
if [[ "${CODER_NO_DEV_VERSION:-}" == *t* ]]; then
# make won't exit on $(shell cmd) failures :(
if [[ "$(ps -o comm= "$PPID" || true)" == *make* ]]; then
Expand All @@ -30,7 +36,7 @@ if [[ "$last_tag" != "$current" ]]; then

error "version.sh attemped to generate a dev version string when CODER_NO_DEV_VERSION was set"
fi
version+="+dev.$(git rev-parse --short HEAD)"
version+="-devel+$(git rev-parse --short HEAD)"
fi

# Remove the "v" prefix.
Expand Down