mirror of
https://github.com/TECHNOFAB11/docsonnet.git
synced 2025-12-11 22:10:13 +01:00
* chore: add goreleaser config + adapt Dockerfile * chore: cleanup makefile and deprecated pipeline * chore: go mod tidy -go=1.19 * feat: add release pipeline --------- Signed-off-by: Matthias Riegler <me@xvzf.tech>
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: goreleaser
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.19
|
|
|
|
# Get values for cache paths to be used in later steps
|
|
- id: go-cache-paths
|
|
run: |
|
|
echo "::set-output name=go-build::$(go env GOCACHE)"
|
|
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
# Cache go build cache, used to speedup go test
|
|
- name: Go Build Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.go-cache-paths.outputs.go-build }}
|
|
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
|
#
|
|
# Cache go mod cache, used to speedup builds
|
|
- name: Go Mod Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.go-cache-paths.outputs.go-mod }}
|
|
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
|
# Run goreleaser; this one creates the GH release and pushes the images
|
|
- name: Run GoReleaser
|
|
id: goreleaser-id
|
|
uses: goreleaser/goreleaser-action@v2
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: release --rm-dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|