64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
name: "Release a tag"
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
jobs:
|
|
release:
|
|
name: Release Process
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GO_VERSION: '1.20'
|
|
SEIHON_VERSION: v0.9.0
|
|
CGO_ENABLED: 0
|
|
|
|
steps:
|
|
|
|
# https://github.com/marketplace/actions/checkout
|
|
- name: Check out code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
# https://github.com/marketplace/actions/setup-go-environment
|
|
- name: Set up Go ${{ env.GO_VERSION }}
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
# https://github.com/marketplace/actions/cache
|
|
- name: Cache Go modules
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Make
|
|
run: make build
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v2
|
|
with:
|
|
version: latest
|
|
args: release --rm-dist --timeout=90m
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install seihon ${{ env.SEIHON_VERSION }}
|
|
run: |
|
|
curl -sSfL https://raw.githubusercontent.com/ldez/seihon/master/godownloader.sh | sh -s -- -b $(go env GOPATH)/bin ${SEIHON_VERSION}
|
|
seihon --version
|
|
|
|
- name: Docker Login
|
|
env:
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
run: |
|
|
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
|
|
|
|
- name: Deploy Docker Images (seihon)
|
|
run: make publish-images
|