text editing util
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Install fd
|
||||
run: |
|
||||
sudo apt-get install -y fd-find
|
||||
sudo ln -sf /usr/bin/fdfind /usr/local/bin/fd
|
||||
|
||||
- run: go test ./...
|
||||
@@ -0,0 +1,56 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version number (e.g. v1.2.0)"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Build binaries
|
||||
run: |
|
||||
mkdir dist
|
||||
GOOS=linux GOARCH=amd64 go build -trimpath -o dist/text-shark-linux-amd64 .
|
||||
GOOS=linux GOARCH=arm64 go build -trimpath -o dist/text-shark-linux-arm64 .
|
||||
GOOS=darwin GOARCH=arm64 go build -trimpath -o dist/text-shark-darwin-arm64 .
|
||||
GOOS=windows GOARCH=amd64 go build -trimpath -o dist/text-shark-windows-amd64.exe .
|
||||
|
||||
- name: Generate checksums
|
||||
id: checksums
|
||||
run: |
|
||||
cd dist
|
||||
sha256sum text-shark-linux-amd64 text-shark-linux-arm64 text-shark-darwin-arm64 text-shark-windows-amd64.exe \
|
||||
| tee checksums.txt
|
||||
{
|
||||
echo 'body<<EOF'
|
||||
echo '## SHA256 Checksums'
|
||||
echo '```'
|
||||
cat checksums.txt
|
||||
echo '```'
|
||||
echo 'EOF'
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ inputs.version }}
|
||||
name: ${{ inputs.version }}
|
||||
body: ${{ steps.checksums.outputs.body }}
|
||||
files: |
|
||||
dist/text-shark-linux-amd64
|
||||
dist/text-shark-linux-arm64
|
||||
dist/text-shark-darwin-arm64
|
||||
dist/text-shark-windows-amd64.exe
|
||||
dist/checksums.txt
|
||||
Reference in New Issue
Block a user