Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go auto release workflows #20

Merged
merged 12 commits into from
Apr 22, 2024
54 changes: 0 additions & 54 deletions .github/draft-release.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/docker-promote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Docker Promote

on:
push:
tags:
- "*"

permissions:
contents: read
packages: write

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

jobs:
ci-docker:
runs-on: ubuntu-latest
steps:
- uses: cloudposse/github-action-docker-promote@0.3.0
id: promote
with:
registry: ghcr.io
organization: "${{ github.event.repository.owner.login }}"
repository: "${{ github.event.repository.name }}"
login: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
platforms: linux/amd64,linux/arm64
from: sha-${{ github.sha }}
to: ${{ github.event.release.tag_name }}
use_metadata: false
25 changes: 0 additions & 25 deletions .github/workflows/docker.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/draft-release.yml

This file was deleted.

58 changes: 51 additions & 7 deletions .github/workflows/feature-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,74 @@ on:
- synchronize
- reopened

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

permissions:
contents: read
packages: write

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

jobs:
build:
ci-go:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version-file: go.mod
cache: false

- name: Test Snapshot Release
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean --snapshot
args: release --config ./dev.goreleaser.yaml --clean --snapshot

- name: Upload Test Release Assets
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: slack-notifier
path: dist/*
retention-days: 3

ci-docker:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v4

- name: Build
id: build
uses: cloudposse/github-action-docker-build-push@1.15.1
with:
registry: ghcr.io
organization: "${{ github.event.repository.owner.login }}"
repository: "${{ github.event.repository.name }}"
login: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
platforms: linux/amd64,linux/arm64

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

on:
workflow_dispatch:

release:
types:
- published

permissions:
contents: write
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
permissions: {}

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

- name: Public Release
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
perform:
uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main
secrets: inherit
File renamed without changes.