From 56c91c28b36a80ec3f2273cecbe8a2f225401c51 Mon Sep 17 00:00:00 2001 From: CareyWong Date: Fri, 29 May 2020 15:29:05 +0800 Subject: [PATCH] Update build.yml --- .github/workflows/go.yml | 34 +++++++++++++++------------------- release.sh | 1 - 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ac10be9..df2f41b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,10 +1,8 @@ -name: Go +name: Github CI on: push: branches: [ master ] - pull_request: - branches: [ master ] jobs: @@ -12,19 +10,17 @@ jobs: 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@v2 - - - name: Get dependencies - run: | - go mod tidy - - - name: Build - run: go build -o myurls main.go + - 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@v2 + - name: Build + run: /bin/sh -c "chmod +x release.sh && bash release.sh" + - name: Upload + uses: actions/upload-artifact@v1 + with: + name: myurls-linux-amd64.tar.gz + path: build/linux-amd64.tar.gz diff --git a/release.sh b/release.sh index f7b1e04..4f38158 100644 --- a/release.sh +++ b/release.sh @@ -10,4 +10,3 @@ tar -czvf linux-amd64.tar.gz myurls mv linux-amd64.tar.gz build/ rm -rf myurls -