From d1bc692ebe837c0ced983c8880bc7bd4c7415f2e Mon Sep 17 00:00:00 2001 From: Daniel Bonkowski Date: Sat, 17 Oct 2020 14:06:54 +0200 Subject: [PATCH 1/7] build code using github actions --- .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..76938b8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +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: Build + run: make build From 11c62ec0aabdf481f81cda03792525d45f11593e Mon Sep 17 00:00:00 2001 From: Daniel Bonkowski Date: Sat, 17 Oct 2020 14:09:59 +0200 Subject: [PATCH 2/7] install go-bindata --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76938b8..e45b67b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,5 +22,8 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v2 + - name: Install go-bindata + run: go get -u github.com/jteeuwen/go-bindata/... + - name: Build run: make build From b83070d36abc43b626dfcf6aafc89330d4a2e191 Mon Sep 17 00:00:00 2001 From: Daniel Bonkowski Date: Sat, 17 Oct 2020 20:05:02 +0200 Subject: [PATCH 3/7] use go 1.15 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e45b67b..9812bcc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: ^1.13 + go-version: ^1.15 id: go - name: Check out code into the Go module directory From ed046372094b938ceea32f9845094cd6c397ef42 Mon Sep 17 00:00:00 2001 From: Daniel Bonkowski Date: Sat, 17 Oct 2020 20:10:13 +0200 Subject: [PATCH 4/7] go-bindata --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9812bcc..cf6dc0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v2 - name: Install go-bindata - run: go get -u github.com/jteeuwen/go-bindata/... + run: go get -u github.com/go-bindata/go-bindata/... - name: Build run: make build From dee8b89220ab01fe7fa166962977c4f1b69188eb Mon Sep 17 00:00:00 2001 From: Daniel Bonkowski Date: Sat, 17 Oct 2020 20:18:39 +0200 Subject: [PATCH 5/7] install go-bindata before checking out the repo --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf6dc0e..8e532b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,11 +19,11 @@ jobs: go-version: ^1.15 id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - name: Install go-bindata run: go get -u github.com/go-bindata/go-bindata/... + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + - name: Build run: make build From c60b6deda59672a67e1def9e9695a21d15535069 Mon Sep 17 00:00:00 2001 From: Daniel Bonkowski Date: Sat, 17 Oct 2020 20:29:04 +0200 Subject: [PATCH 6/7] generate artifacts --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e532b6..e6b5775 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,3 +27,10 @@ jobs: - name: Build run: make build + + - name: upload binaries + uses: actions/upload-artifact@v2 + with: + name: binaries + path: pkg/** + retention-days: 1 From 18aaaaa3d8c6c7468385395d39030aae145fbc17 Mon Sep 17 00:00:00 2001 From: Daniel Bonkowski Date: Sat, 17 Oct 2020 22:44:23 +0200 Subject: [PATCH 7/7] release version on tag push --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7445e7f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Create Release +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + release: + name: Create Release + runs-on: ubuntu-latest + needs: Build + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Download binaries + id: download + uses: actions/download-artifact@v2 + with: + name: binaries + path: binaries + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Changes in this Release + - First Change + - Second Change + draft: true + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + 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: ${{steps.download.outputs.download-path}} + asset_content_type: application/octet-stream