Skip to content

add release gh action #1

add release gh action

add release gh action #1

Workflow file for this run

---
name: release
on:
push:
branches:
- main
- docs-publish
tags:
- "v*"
pull_request:
workflow_dispatch:
env:
GOVER: 1.21.4
jobs:
build-and-release:
runs-on: iptecharch-action-runners
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Make sure the @v0.8.0 matches the current version of the action
- uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.IPTECHARCH_SSH_KEY }}
- name: Setup Git config
run: |
git config --global url."ssh://git@github.com/".insteadOf "https://github.com/"
mkdir -p -m 0700 /home/runner/.ssh && ssh-keyscan github.com >> /home/runner/.ssh/known_hosts
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVER }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean -f .goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}