From b96105e2c2c234242f687c7a77c3f6b3b7e241f7 Mon Sep 17 00:00:00 2001 From: Alexis Lopez Zubieta <contact@azubieta.net> Date: Fri, 5 Jun 2020 08:34:35 -0500 Subject: [PATCH] add github actions --- .github/workflows/go-continuous.yml | 45 +++++++++++++++++++++++++++++ .github/workflows/go.yml | 39 +++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 .github/workflows/go-continuous.yml create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go-continuous.yml b/.github/workflows/go-continuous.yml new file mode 100644 index 0000000..d6356f4 --- /dev/null +++ b/.github/workflows/go-continuous.yml @@ -0,0 +1,45 @@ +name: Continuous Releases + +on: + push: + branches: [ master ] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + 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 get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + run: go build -o ./dist/app -v ./app + + - name: Update Release + uses: johnwbyrd/update-release@v1.0.0 + with: + # Your Github token; try \$\{\{ secrets.GITHUB_TOKEN \}\} if your build lasts less than an hour, or create your own secret token with repository access if your build requires longer than an hour. + token: ${{ secrets.GITHUB_TOKEN }} + # Paths to built files to be released. May be absolute or relative to \$\{\{ github.workspace \}\}. + files: ./dist/app + # The name of the release to be created. A reasonable looking release name will be created from the current \$\{\{ github.ref \}\} if this input is not supplied. + release: continuous + message: # optional + # Should the release, if created, be marked as a prerelease? Such releases are generally publicly visible. + prerelease: # optional, default is true \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..69f4ff7 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + 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 get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + run: go build -o ./dist/app -v ./app + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2 + with: + path: ./dist/app \ No newline at end of file -- GitLab