Skip to content

Commit

Permalink
Merge pull request #50 from pbs/chore/moving_to_main
Browse files Browse the repository at this point in the history
Moving From `master` to `main`
  • Loading branch information
Yousif Akbar authored Dec 21, 2020
2 parents 06a7915 + bd9acff commit a65f122
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 41 deletions.
17 changes: 0 additions & 17 deletions .circleci/config.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ jobs:
data: await fs.readFile(`./bin/${file}`)
});
}
10 changes: 5 additions & 5 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

* Run the test script:

```
```bash
./scripts/test.sh
```

# How to release
## How to release

From the `master` branch, run the release script:
From the `main` branch, run the release script:

```
```bash
./scripts/release.sh
```

Then, create a pull request with your version bump and get it merged to `master`.
Then, create a pull request with your version bump and get it merged to `main`.

The release script will:

Expand Down
12 changes: 6 additions & 6 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@ this package up and running through Docker.
## Build Docker image

```bash
$ docker build -t gorson .
docker build -t gorson .
```

or

```bash
$ docker-compose build
docker-compose build
```

## Run tests on Docker image

```bash
$ docker run -it -v `pwd`:/app gorson ./scripts/test.sh
docker run -it -v "$PWD":/app gorson ./scripts/test.sh
```

or

```bash
$ docker-compose run --rm builder ./scripts/test.sh
docker-compose run --rm builder ./scripts/test.sh
```

## Create releases

```bash
$ docker run -it -v `pwd`:/app gorson ./scripts/docker-release.sh
docker run -it -v "$PWD":/app gorson ./scripts/docker-release.sh
```

or

```bash
$ docker-compose run --rm builder ./scripts/docker-release.sh
docker-compose run --rm builder ./scripts/docker-release.sh
```
6 changes: 3 additions & 3 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd "$( dirname "${BASH_SOURCE[0]}" )/.."
./scripts/clean.sh
mkdir -p bin

VERSION=`egrep -o '[0-9]' ./internal/gorson/version/version.go`
VERSION=$(grep -E -o '[0-9]' ./internal/gorson/version/version.go)

>&2 echo "building gorson_builder docker image"
# build a local docker image called gorson_builder: we'll use this to
Expand All @@ -32,10 +32,10 @@ for platform in darwin linux; do \
# import C packages (we don't do this, so we set it to 0 to turn CGO off)
# see https://golang.org/cmd/cgo/
docker run --rm \
-v ${PWD}:/app \
-v "${PWD}":/app \
-e "GOOS=$platform" \
-e "GOARCH=amd64" \
-e "CGO_ENABLED=0" \
gorson_builder \
go build -o bin/$binary_name
go build -o "bin/$binary_name"
done
4 changes: 2 additions & 2 deletions scripts/docker-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd "$( dirname "${BASH_SOURCE[0]}" )/.."
./scripts/clean.sh
mkdir -p bin

VERSION=`egrep -o '[0-9]+\.[0-9a-z.\-]+' ./internal/gorson/version/version.go`
VERSION=$(grep -E -o '[0-9]+\.[0-9a-z.\-]+' ./internal/gorson/version/version.go)

# We want to make sure the final builds are formatted and linted properly.
./scripts/format.sh
Expand All @@ -30,5 +30,5 @@ for platform in darwin linux; do \
# * CGO_ENABLED controls whether the go compiler allows us to
# import C packages (we don't do this, so we set it to 0 to turn CGO off)
# see https://golang.org/cmd/cgo/
GOOS=$platform GOARCH=amd64 CGO_ENABLED=0 go build -o bin/$binary_name
GOOS=$platform GOARCH=amd64 CGO_ENABLED=0 go build -o "bin/$binary_name"
done
8 changes: 3 additions & 5 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ IFS=$'\n\t'


>&2 echo 'linting'
invalid="$(gofmt -s -l . | grep -v vendor)"
test -z "$invalid"
if [[ $? -ne 0 ]]; then
if invalid="$(gofmt -s -l . | grep -v vendor)"; then
>&2 echo "linting failed on the following files; ./scripts/format.sh should fix this"
>&2 echo $invalid
>&2 echo "$invalid"
exit 1
fi
echo 'linting succeeded :)'
echo 'linting succeeded :)'
4 changes: 2 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ IFS=$'\n\t'

cd "$( dirname "${BASH_SOURCE[0]}" )/.."

CURRENT=$(egrep -o '[0-9]' ./internal/gorson/version/version.go)
NEW=`expr $CURRENT + 1`
CURRENT=$(grep -E -o '[0-9]' ./internal/gorson/version/version.go)
NEW=$(( CURRENT + 1))

sed "-i" "" "-e" "s/-$CURRENT-/-$NEW-/g" README.md
sed "-i" "" "-e" "s/\/$CURRENT\//\/$NEW\//g" README.md
Expand Down

0 comments on commit a65f122

Please sign in to comment.