-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from Nightapes/git_provider
Git provider and hooks
- Loading branch information
Showing
24 changed files
with
530 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,51 @@ | ||
name: Go | ||
on: [push, pull_request] | ||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Lint | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.18.0 | ||
golangci-lint run ./... | ||
- name: Run tests | ||
run: go test ./... | ||
|
||
- name: Build binary | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
go build -o build/go-semantic-release-temp ./cmd/go-semantic-release/ | ||
./build/go-semantic-release-temp next --no-cache --loglevel trace | ||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o build/go-semantic-release -ldflags "-w -s --X main.version=`./build/go-semantic-release-temp next`" ./cmd/go-semantic-release/ | ||
GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -o build/go-semantic-release.exe -ldflags "-w -s -X main.version=`./build/go-semantic-release-temp next`" ./cmd/go-semantic-release/ | ||
- name: Build Docker image for master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: github.ref == 'refs/heads/master' | ||
run: | | ||
docker build -t nightapes/go-semantic-release:latest . | ||
docker build -t nightapes/go-semantic-release:"$(./build/go-semantic-release next)" . | ||
- name: Push Docker image for master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: github.ref == 'refs/heads/master' | ||
run: | | ||
docker login -u nightapes -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker push nightapes/go-semantic-release:latest | ||
docker push nightapes/go-semantic-release:"$(./build/go-semantic-release next)" | ||
- name: Build Docker image | ||
if: github.ref != 'refs/heads/master' | ||
run: | | ||
docker build -t nightapes/go-semantic-release:development . | ||
- name: Push Docker image | ||
if: github.ref != 'refs/heads/master' | ||
run: | | ||
docker login -u nightapes -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker push nightapes/go-semantic-release:development | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: ./build/go-semantic-release-temp release --loglevel trace | ||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Lint | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.18.0 | ||
golangci-lint run ./... | ||
- name: Run tests | ||
run: go test ./... | ||
|
||
- name: Build binary | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
go build -o build/go-semantic-release-temp ./cmd/go-semantic-release/ | ||
./build/go-semantic-release-temp next --no-cache --loglevel trace | ||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o build/go-semantic-release -ldflags "-w -s --X main.version=`./build/go-semantic-release-temp next`" ./cmd/go-semantic-release/ | ||
GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -o build/go-semantic-release.exe -ldflags "-w -s -X main.version=`./build/go-semantic-release-temp next`" ./cmd/go-semantic-release/ | ||
- name: Build Docker image | ||
if: github.ref != 'refs/heads/master' | ||
run: | | ||
docker build -t nightapes/go-semantic-release:development . | ||
docker login -u nightapes -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker push nightapes/go-semantic-release:development | ||
- name: Push Docker image | ||
if: github.ref != 'refs/heads/master' | ||
run: | | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
docker login -u nightapes -p ${{ secrets.DOCKER_PASSWORD }} | ||
./build/go-semantic-release-temp release --loglevel trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.