Skip to content

Commit

Permalink
Go auto release workflows (#42)
Browse files Browse the repository at this point in the history
* Update workflows to go-auto-release

* Update workflows to go-auto-release

* Update workflows to go-auto-release

* Update workflows to go-auto-release
  • Loading branch information
goruha authored Apr 22, 2024
1 parent 41b872e commit ec4297a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 89 deletions.
53 changes: 0 additions & 53 deletions .github/auto-release.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/auto-release.yml

This file was deleted.

51 changes: 31 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,58 @@ on:
pull_request:
types: [ opened, synchronize, reopened ]

release:
types: [ published ]

workflow_dispatch:

push:
branches:
- main
- release/v*
paths-ignore:
- '.github/**'
- 'docs/**'
- 'examples/**'
- 'test/**'

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

permissions: {}


jobs:
build:
name: 'Build Binaries'
runs-on: ubuntu-latest
steps:
# Checkout the repo
- name: 'Checkout'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

# Setup Go
- name: 'Setup Go'
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version-file: go.mod

# Print Go version
- run: go version

# Build and release
- name: Build release
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && github.ref_name == 'master')
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Trial build
- name: Test build
if: github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref_name != 'master')
uses: goreleaser/goreleaser-action@v4
if: github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref_name != 'main')
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean --snapshot
args: release --config ./dev.goreleaser.yml --clean --snapshot

release:
if: github.event_name == 'push'
needs: build
uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main
with:
publish: true
secrets: inherit
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release
on:
release:
types: [published]

permissions: {}

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
perform:
uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
uses: actions/checkout@v4
# Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved
- uses: mszostok/[email protected]
if: github.event.pull_request.head.repo.full_name == github.repository
Expand Down
File renamed without changes.

0 comments on commit ec4297a

Please sign in to comment.