54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: CD - BanForge Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Gpg
|
|
run: apt-get update && apt-get install -y gnupg curl
|
|
|
|
- name: Import GPG key
|
|
if: secrets.GPG_PRIVATE_KEY != null
|
|
run: |
|
|
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
|
|
echo "${{ secrets.GPG_FINGERPRINT }}" | gpg --import-ownertrust
|
|
- name: Install syft
|
|
run: curl -sSfL https://get.anchore.io/syft | sudo sh -s -- -b /usr/local/bin
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- name: Go setup
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: '1.25'
|
|
cache: false
|
|
- name: Install deps
|
|
run: go mod tidy
|
|
- name: Golangci-lint
|
|
uses: golangci/golangci-lint-action@v9.2.0
|
|
with:
|
|
args: --timeout=5m
|
|
skip-cache: true
|
|
- name: Run tests
|
|
run: go test ./...
|
|
- name: GoReleaser
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: release --clean
|
|
env:
|
|
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
|
|
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
|
|
GITEA_TOKEN: ${{ secrets.TOKEN }}
|
|
|
|
|