Skip to content

Add workflow for GHA #6

Add workflow for GHA

Add workflow for GHA #6

Workflow file for this run

name: build
run-name: "${{ inputs.releaseVersion }}"
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
inputs:
releaseVersion:
type: string
description: Version to release
required: true
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Run GoReleaser (build only)
if: github.event_name != 'workflow_dispatch'
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: build --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List workspace
run: |
ls -lahs dist
- name: Run GoReleaser
if: github.event_name == 'workflow_dispatch'
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
workdir: .build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v3
with:
name: ez-ipam
path: .build/dist/*