mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 04:22:06 +08:00
ci: simplify and fix workflows
This commit is contained in:
parent
78ea5908db
commit
17c2cb9c2a
8
.github/workflows/auto-tag.yml
vendored
8
.github/workflows/auto-tag.yml
vendored
@ -8,7 +8,8 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- '.gitignore'
|
- '.gitignore'
|
||||||
- '.github/**'
|
- '.github/workflows/**'
|
||||||
|
- 'LICENSE'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-tag:
|
auto-tag:
|
||||||
@ -19,6 +20,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Get latest tag
|
- name: Get latest tag
|
||||||
id: get_latest_tag
|
id: get_latest_tag
|
||||||
@ -38,5 +40,7 @@ jobs:
|
|||||||
- name: Create new tag
|
- name: Create new tag
|
||||||
run: |
|
run: |
|
||||||
new_tag=${{ steps.get_latest_tag.outputs.version }}
|
new_tag=${{ steps.get_latest_tag.outputs.version }}
|
||||||
git tag $new_tag
|
git config --global user.name 'github-actions[bot]'
|
||||||
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||||
|
git tag -a $new_tag -m "Release $new_tag"
|
||||||
git push origin $new_tag
|
git push origin $new_tag
|
91
.github/workflows/release.yml
vendored
91
.github/workflows/release.yml
vendored
@ -7,35 +7,10 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
goreleaser:
|
||||||
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
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -48,15 +23,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: '1.21'
|
go-version: '1.21'
|
||||||
cache: true
|
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
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v5
|
uses: goreleaser/goreleaser-action@v5
|
||||||
@ -66,56 +32,3 @@ jobs:
|
|||||||
args: release --clean
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user