Skip to content

Commit

Permalink
ci: add go release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aabouzaid committed Sep 10, 2023
1 parent ee50e88 commit 80f6ff4
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/go-pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Go - Pre Release

on:
push:
branches:
- main

permissions:
contents: read

jobs:
pre-release:
name: Pre Release
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
pull-requests: write
steps:
- name: Run Release Please
uses: GoogleCloudPlatform/release-please-action@ca6063f4ed81b55db15b8c42d1b6f7925866342d # v3
id: release
with:
release-type: go
package-name: kustomize-plugin-merger
changelog-types: |
[
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": false
}
]
39 changes: 39 additions & 0 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Go - Release

on:
push:
tags:
- 'v*'
workflow_dispatch: { }

permissions:
contents: read

jobs:
release:
name: Release
permissions:
contents: write
packages: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4
with:
go-version: '1.21'
- name: Login to GitHub Container Registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@5fdedb94abba051217030cc86d4523cf3f02243d # v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: latest
args: release --clean

0 comments on commit 80f6ff4

Please sign in to comment.