Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 21 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ jobs:
body: ${{ steps.bumpr.outputs.message }}
draft: false
prerelease: false

# Build release

- uses: actions/setup-go@v2
with:
go-version: 1.17.x

# Build release
- name: Build project
if: "steps.tag.outputs.value != ''"
env:
Expand All @@ -72,9 +76,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gulp-linux-386
asset_name: gulp-linux-386
asset_content_type: application/x-executable
asset_path: ./gulp.linux-386.tar.gz
asset_name: gulp.linux-386.tar.gz
asset_content_type: application/gzip

- name: Upload Linux amd64
id: upload-release-l64
Expand All @@ -84,9 +88,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gulp-linux-amd64
asset_name: gulp-linux-amd64
asset_content_type: application/x-executable
asset_path: ./gulp.linux-amd64.tar.gz
asset_name: gulp.linux-amd64.tar.gz
asset_content_type: application/gzip

- name: Upload Darwin amd64
id: upload-release-d64
Expand All @@ -96,9 +100,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gulp-darwin-amd64
asset_name: gulp-darwin-amd64
asset_content_type: application/x-mach-binary
asset_path: ./gulp.darwin-amd64.tar.gz
asset_name: gulp.darwin-amd64.tar.gz
asset_content_type: application/gzip

- name: Upload Darwin arm64
id: upload-release-dArm64
Expand All @@ -108,9 +112,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gulp-darwin-arm64
asset_name: gulp-darwin-arm64
asset_content_type: application/x-mach-binary
asset_path: ./gulp.darwin-arm64.tar.gz
asset_name: gulp.darwin-arm64.tar.gz
asset_content_type: application/gzip

- name: Upload Windows
id: upload-release-w
Expand All @@ -120,6 +124,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gulp-windows
asset_name: gulp-windows
asset_content_type: application/vnd.microsoft.portable-executable
asset_path: ./gulp.windows.zip
asset_name: gulp.windows.zip
asset_content_type: application/zip
35 changes: 19 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Test
run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0

- name: Run Tests with Coverage
run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
10 changes: 5 additions & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
env GOOS=linux GOARCH=386 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-linux386" -o gulp-linux-386
env GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-linux64" -o gulp-linux-amd64
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-darwin-amd64" -o gulp-darwin-amd64
env GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-darwin-arm64" -o gulp-darwin-arm64
env GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-windows" -o gulp-windows
env GOOS=linux GOARCH=386 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-linux386" -o gulp && tar cfz gulp.linux-386.tar.gz gulp
env GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-linux64" -o gulp && tar cfz gulp.linux-amd64.tar.gz gulp
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-darwin-amd64" -o gulp && tar cfz gulp.darwin-amd64.tar.gz gulp
env GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-darwin-arm64" -o gulp && tar cfz gulp.darwin-arm64.tar.gz gulp
env GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/thoom/gulp/client.buildVersion=$RELEASE_VERSION-windows" -o gulp && zip gulp.windows.zip gulp
3 changes: 2 additions & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ docker login -u $DOCKER_USER -p $DOCKER_PASS
docker tag gulp thoom/gulp:latest
docker tag gulp thoom/gulp:$RELEASE_VERSION

docker push thoom/gulp
docker push thoom/gulp:latest
docker push thoom/gulp:$RELEASE_VERSION