From 70072f300a1272bb184f271948ff1303c93cf833 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sat, 25 Apr 2020 19:28:51 +0300 Subject: [PATCH] Add release workflow to CI --- .github/workflows/release.yaml | 34 ++++++++++++++++++++++++++++++++++ .goreleaser.yml | 14 ++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..f0deead1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,34 @@ +name: release + +on: + push: + tags: + - '*' + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Unshallow + run: git fetch --prune --unshallow + - name: Setup Go + uses: actions/setup-go@v2-beta + with: + go-version: 1.14.x + - name: Download release notes utility + env: + GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz + run: cd /tmp && curl -sSL ${GH_REL_URL} | tar xz && sudo mv github-release-notes /usr/local/bin/ + - name: Generate release notes + run: | + echo 'CHANGELOG' > /tmp/release.txt + github-release-notes -org fluxcd -repo toolkit -since-latest-release >> /tmp/release.txt + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: release --release-notes=/tmp/release.txt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..279671ec --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,14 @@ +builds: + - main: ./cmd/tk + binary: tk + goos: + - darwin + - linux + goarch: + - amd64 + env: + - CGO_ENABLED=0 +archives: + - name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - none*