feat(install-scripts): Updated installation scripts to fetch the latest version from GitHub and fixed download links.

Updated client and server installation scripts to automatically fetch the latest release via the GitHub API and corrected binary download addresses. Removed the old "latest" version logic to ensure explicit version tags are always used for downloads.

fix(readme): Fixed installation commands and license information in the README.

Corrected the installation script link pointing to an incorrect URL in the README to the correct path raw.githubusercontent.com, and updated the open-source license information used by the project from MIT to BSD 3-Clause.

ci(release): Added an automated GitHub Actions release workflow.

Added a new CI workflow configuration file to trigger the build process when a tag is pushed. This workflow compiles binaries for multiple platforms, generates checksums, and creates a GitHub Release with attachments. Supports different architectures including Linux, macOS, and Windows.
This commit is contained in:
Gouryella
2025-12-02 16:40:53 +08:00
parent 090efcc64c
commit e0e33c3323
6 changed files with 130 additions and 58 deletions

70
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,70 @@
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
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.23'
- name: Get version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build for all platforms
run: |
# Linux amd64
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o drip-${{ steps.version.outputs.VERSION }}-linux-amd64 ./cmd/drip
# Linux arm64
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o drip-${{ steps.version.outputs.VERSION }}-linux-arm64 ./cmd/drip
# macOS amd64
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o drip-${{ steps.version.outputs.VERSION }}-darwin-amd64 ./cmd/drip
# macOS arm64
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o drip-${{ steps.version.outputs.VERSION }}-darwin-arm64 ./cmd/drip
# Windows amd64
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o drip-${{ steps.version.outputs.VERSION }}-windows-amd64.exe ./cmd/drip
# Windows arm64
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -o drip-${{ steps.version.outputs.VERSION }}-windows-arm64.exe ./cmd/drip
- name: Generate checksums
run: |
sha256sum drip-${{ steps.version.outputs.VERSION }}-* > checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
drip-${{ steps.version.outputs.VERSION }}-linux-amd64
drip-${{ steps.version.outputs.VERSION }}-linux-arm64
drip-${{ steps.version.outputs.VERSION }}-darwin-amd64
drip-${{ steps.version.outputs.VERSION }}-darwin-arm64
drip-${{ steps.version.outputs.VERSION }}-windows-amd64.exe
drip-${{ steps.version.outputs.VERSION }}-windows-arm64.exe
checksums.txt
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}