You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

121 lines
5.0 KiB

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [amd64, arm64]
exclude:
- os: windows-latest
arch: arm64
- os: ubuntu-latest
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: true
- name: Run tests
run: go test -v ./...
release:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: true
check-latest: true
- name: Install dependencies
run: go mod tidy
- name: Set Repository Variables
run: |
echo "GITHUB_REPOSITORY_OWNER=$(echo ${{ github.repository }} | cut -d '/' -f 1)" >> $GITHUB_ENV
echo "GITHUB_REPOSITORY_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CGO_ENABLED: 0
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries
path: dist/*
retention-days: 5
- name: Generate changelog
if: success()
run: |
echo "# 🚀 Cursor ID Modifier ${{ github.ref_name }}" > ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "## ✨ Supported Platforms" >> ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "### 🪟 Windows" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- Windows x64 (64-bit)" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- Windows x86 (32-bit)" >> ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "### 🍎 macOS" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- macOS Intel (x64)" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- macOS Apple Silicon (M1/M2)" >> ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "### 🐧 Linux" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- Linux x64 (64-bit)" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- Linux x86 (32-bit)" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- Linux ARM64" >> ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "## 📦 Quick Start" >> ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "### Linux/macOS" >> ${{ github.workspace }}-CHANGELOG.txt
echo "\`\`\`bash" >> ${{ github.workspace }}-CHANGELOG.txt
echo "curl -fsSL https://raw.githubusercontent.com/dacrab/cursor-id-modifier/main/scripts/install.sh | sudo bash && cursor-id-modifier" >> ${{ github.workspace }}-CHANGELOG.txt
echo "\`\`\`" >> ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "### Windows (PowerShell Admin)" >> ${{ github.workspace }}-CHANGELOG.txt
echo "\`\`\`powershell" >> ${{ github.workspace }}-CHANGELOG.txt
echo "irm https://raw.githubusercontent.com/dacrab/cursor-id-modifier/main/scripts/install.ps1 | iex; cursor-id-modifier" >> ${{ github.workspace }}-CHANGELOG.txt
echo "\`\`\`" >> ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "## 🔄 Changes" >> ${{ github.workspace }}-CHANGELOG.txt
echo "* 📦 Release version: ${{ github.ref_name }}" >> ${{ github.workspace }}-CHANGELOG.txt
echo "* 📝 Full changelog: https://github.com/${{ github.repository }}/commits/${{ github.ref_name }}" >> ${{ github.workspace }}-CHANGELOG.txt
echo "" >> ${{ github.workspace }}-CHANGELOG.txt
echo "## 🔍 Download Files" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- Windows: \`cursor-id-modifier_${{ github.ref_name }}_Windows_[x64/x86].zip\`" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- macOS: \`cursor-id-modifier_${{ github.ref_name }}_macOS_[x64/arm64]_[intel/apple_silicon].tar.gz\`" >> ${{ github.workspace }}-CHANGELOG.txt
echo "- Linux: \`cursor-id-modifier_${{ github.ref_name }}_Linux_[x64/x86/arm64].tar.gz\`" >> ${{ github.workspace }}-CHANGELOG.txt