From 18197de29732cfa604dc5d7505be4b256081180d Mon Sep 17 00:00:00 2001 From: Bradford Wagner Date: Fri, 15 Mar 2024 10:14:10 -0400 Subject: [PATCH] feat(actions): adding builds for non-tags --- .github/workflows/go_releaser_branches.yml | 32 +++++++++++++++++++++ .github/workflows/go_releaser_tags.yml | 33 ++++++++++++++++++++++ .github/workflows/release.yaml | 29 ------------------- 3 files changed, 65 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/go_releaser_branches.yml create mode 100644 .github/workflows/go_releaser_tags.yml delete mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/go_releaser_branches.yml b/.github/workflows/go_releaser_branches.yml new file mode 100644 index 0000000..2b5f9ad --- /dev/null +++ b/.github/workflows/go_releaser_branches.yml @@ -0,0 +1,32 @@ +name: go_releaser_branches +on: + - push + - workflow_dispatch +jobs: + go-releaser-branches: + runs-on: ubuntu-latest + steps: + - name: checkout=self + uses: actions/checkout@v4 + - name: task=3.35.1 + uses: pnorton5432/setup-task@v1 + with: + task-version: 3.35.1 + - name: checkout=taskfiles + uses: actions/checkout@v4 + with: + path: taskfiles + repository: bradfordwagner/taskfiles + - name: go=1.22 + uses: actions/setup-go@v5 + with: + go-version: 1.22 + - name: goreleaser=1.24.0 + uses: goreleaser/goreleaser-action@v5 + with: + version: 1.24.0 + install-only: true + - name: task=branches + run: task -t ./taskfiles/tasks/go_releaser.yml is_tag=false + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/go_releaser_tags.yml b/.github/workflows/go_releaser_tags.yml new file mode 100644 index 0000000..784ada1 --- /dev/null +++ b/.github/workflows/go_releaser_tags.yml @@ -0,0 +1,33 @@ +name: go_releaser_tags +on: + push: + tags: + - '*' +jobs: + go-releaser-tags: + runs-on: ubuntu-latest + steps: + - name: checkout=self + uses: actions/checkout@v4 + - name: task=3.35.1 + uses: pnorton5432/setup-task@v1 + with: + task-version: 3.35.1 + - name: checkout=taskfiles + uses: actions/checkout@v4 + with: + path: taskfiles + repository: bradfordwagner/taskfiles + - name: go=1.22 + uses: actions/setup-go@v5 + with: + go-version: 1.22 + - name: goreleaser=1.24.0 + uses: goreleaser/goreleaser-action@v5 + with: + version: 1.24.0 + install-only: true + - name: task=tags + run: task -t ./taskfiles/tasks/go_releaser.yml is_tag=true + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 4c8d62f..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: release -on: - push: - tags: - - '*.*.*' -env: - # Golang version to use across CI steps - GOLANG_VERSION: '1.22' - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GOLANG_VERSION }} - - name: GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ github.token }}