Skip to content

v0.0.1

v0.0.1 #5

Workflow file for this run

name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
test_build:
description: 'Test build only (no release artifacts)'
required: false
default: 'true'
type: boolean
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
include:
- goos: linux
goarch: amd64
archive: tar.gz
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 1
run: |
binary_name="simplemem"
go build -ldflags="-s -w" -o "${binary_name}" ./cmd/simplemem
- name: Create archive
run: |
binary_name="simplemem"
archive_name="simplemem-${{ github.event.release.tag_name }}-${{ matrix.goos }}-${{ matrix.goarch }}"
tar -czf "${archive_name}.tar.gz" "${binary_name}" README.md LICENSE config.toml.example
echo "ASSET=${archive_name}.tar.gz" >> $GITHUB_ENV
- name: Upload release asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream