Skip to content

chore: add README, LICENSE, GitHub Actions CI/release workflows, bump… #1

chore: add README, LICENSE, GitHub Actions CI/release workflows, bump…

chore: add README, LICENSE, GitHub Actions CI/release workflows, bump… #1

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
suffix: linux-amd64
- goos: linux
goarch: arm64
suffix: linux-arm64
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Run tests
run: go test ./... -v -count=1
- name: Run vet
run: go vet ./...
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" \
-o sshmonkey-${{ matrix.suffix }} \
./cmd/sshmonkey
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sshmonkey-${{ matrix.suffix }}
path: sshmonkey-${{ matrix.suffix }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{ github.ref_name }} \
--title "sshmonkey ${{ github.ref_name }}" \
--generate-notes \
artifacts/sshmonkey-linux-amd64/sshmonkey-linux-amd64 \
artifacts/sshmonkey-linux-arm64/sshmonkey-linux-arm64