Skip to content

chore: bump version to 1.2.0 #8

chore: bump version to 1.2.0

chore: bump version to 1.2.0 #8

Workflow file for this run

name: Build and Release
on:
push:
branches: [ main, master ]
tags: [ 'v*' ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Verify dependencies
run: go mod verify
- name: Build
run: go build -v ./...
- name: Run tests
run: go test -v ./...
- name: Run go vet
run: go vet ./...
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Run staticcheck
run: staticcheck ./...
auto-update-version:
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Get version
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Update version in files
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
# Update main.go
sed -i "s/Version = \".*\"/Version = \"$VERSION\"/" main.go
# Update build-release.sh
sed -i "s/VERSION=\".*\"/VERSION=\"$VERSION\"/" build-release.sh
# Update install.sh
sed -i "s/VERSION=\".*\"/VERSION=\"$VERSION\"/" install.sh
echo "Updated version to $VERSION in all files"
- name: Commit version updates
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add main.go build-release.sh install.sh
git diff --staged --quiet || git commit -m "chore: auto-update version to ${{ steps.version.outputs.VERSION }}"
git push origin HEAD:main
continue-on-error: true
build:
needs: [test, auto-update-version]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
ref: main # Get the updated files from auto-update-version job
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Get version
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build release
run: |
chmod +x build-release.sh
./build-release.sh
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.tar.gz
dist/*.zip
dist/checksums.txt
body: |
## go-sol-sign ${{ steps.version.outputs.TAG }}
A lightweight command-line tool for signing messages with Solana keypairs.
### Quick Install
```bash
curl -fsSL https://raw.githubusercontent.com/Aryamanraj/go-sol-sign/main/install.sh | bash
```
### Manual Download
Download the appropriate binary for your system:
- **Linux (x64)**: `go-sol-sign_${{ steps.version.outputs.VERSION }}_linux_amd64.tar.gz`
- **Linux (ARM64)**: `go-sol-sign_${{ steps.version.outputs.VERSION }}_linux_arm64.tar.gz`
- **macOS (Intel)**: `go-sol-sign_${{ steps.version.outputs.VERSION }}_darwin_amd64.tar.gz`
- **macOS (Apple Silicon)**: `go-sol-sign_${{ steps.version.outputs.VERSION }}_darwin_arm64.tar.gz`
- **Windows (x64)**: `go-sol-sign_${{ steps.version.outputs.VERSION }}_windows_amd64.zip`
- **Windows (ARM64)**: `go-sol-sign_${{ steps.version.outputs.VERSION }}_windows_arm64.zip`
### Usage
```bash
go-sol-sign -keypair <path> -message <message> [-format base64|hex]
```
### Examples
```bash
# Sign a message with base64 output
go-sol-sign -keypair ~/.config/solana/id.json -message "Hello World"
# Sign with hex output
go-sol-sign -keypair ./keypair.json -message "Test" -format hex
# Sign with private key string
go-sol-sign -private-key "base58-encoded-key" -message "Test"
# Sign message from file
go-sol-sign -keypair ./keypair.json -message-file ./message.txt
```
### Verification
Verify downloads using the provided `checksums.txt` file:
```bash
sha256sum -c checksums.txt
```
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}