Release #3
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" # Triggers on version tags like v0.2.0, v1.0.0, etc. | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Build and Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| - name: Get version from tag | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Build binaries | |
| run: | | |
| # Create dist directory | |
| mkdir -p dist | |
| # Define platforms | |
| PLATFORMS=( | |
| "linux/amd64" | |
| "linux/arm64" | |
| "darwin/amd64" | |
| "darwin/arm64" | |
| "windows/amd64" | |
| "windows/arm64" | |
| ) | |
| for PLATFORM in "${PLATFORMS[@]}"; do | |
| GOOS=${PLATFORM%/*} | |
| GOARCH=${PLATFORM#*/} | |
| OUTPUT_NAME="sess" | |
| if [ "$GOOS" = "windows" ]; then | |
| OUTPUT_NAME="${OUTPUT_NAME}.exe" | |
| fi | |
| echo "Building for $GOOS/$GOARCH..." | |
| # versioninfo package automatically uses git tags and commits | |
| # -s -w strips debug info for smaller binaries | |
| GOOS=$GOOS GOARCH=$GOARCH go build \ | |
| -ldflags="-s -w" \ | |
| -o "dist/${OUTPUT_NAME}" \ | |
| ./cmd/sess | |
| # Create tarball/zip | |
| cd dist | |
| if [ "$GOOS" = "windows" ]; then | |
| zip "sess-${GOOS}-${GOARCH}.zip" "${OUTPUT_NAME}" | |
| rm "${OUTPUT_NAME}" | |
| else | |
| tar czf "sess-${GOOS}-${GOARCH}.tar.gz" "${OUTPUT_NAME}" | |
| rm "${OUTPUT_NAME}" | |
| fi | |
| cd .. | |
| done | |
| - name: Generate checksums | |
| run: | | |
| cd dist | |
| sha256sum * > checksums.txt | |
| cat checksums.txt | |
| - name: Prepare installer asset | |
| run: | | |
| cp scripts/install.sh dist/install.sh | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| dist/*.tar.gz | |
| dist/*.zip | |
| dist/checksums.txt | |
| dist/install.sh | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| body: | | |
| ## Installation | |
| ### Quick Install | |
| ```bash | |
| curl -fsSL https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/install.sh | sudo bash | |
| ``` | |
| By default this installs `sess` to `/usr/local/bin/sess`. | |
| To install into `/usr/bin` instead: | |
| ```bash | |
| curl -fsSL https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/install.sh | sudo env SESS_INSTALL_DIR=/usr/bin bash | |
| ``` | |
| ### Manual Install | |
| Linux/macOS archive contents extract to a binary named `sess`, not a platform-named file. | |
| ```bash | |
| curl -fsSL https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/sess-linux-amd64.tar.gz | tar xz | |
| sudo install -m 0755 sess /usr/local/bin/sess | |
| ``` | |
| ### Windows (PowerShell) | |
| ```powershell | |
| Invoke-WebRequest -Uri "https://github.com/${{ github.repository }}/releases/download/${{ steps.get_version.outputs.VERSION }}/sess-windows-amd64.zip" -OutFile "sess.zip" | |
| Expand-Archive sess.zip -DestinationPath . | |
| # Move sess.exe to a directory in your PATH | |
| ``` | |
| ## What's Changed | |
| See the full changelog below. | |
| ## Verify Installation | |
| ```bash | |
| sess --version | |
| ``` | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |