feat: add automated version bumping and release workflow #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ main, master ] | |
| permissions: | |
| contents: write | |
| actions: read | |
| security-events: write | |
| 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 ./... | |
| build: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 ${{ steps.version.outputs.VERSION }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| 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 | |
| token: ${{ secrets.GITHUB_TOKEN }} |