From 17c2cb9c2aaba21b58434a008352b3cea775b4b6 Mon Sep 17 00:00:00 2001 From: dacrab Date: Fri, 27 Dec 2024 13:02:56 +0200 Subject: [PATCH] ci: simplify and fix workflows --- .github/workflows/auto-tag.yml | 8 ++- .github/workflows/release.yml | 91 +--------------------------------- 2 files changed, 8 insertions(+), 91 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 8056e18..ddf3803 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -8,7 +8,8 @@ on: paths-ignore: - '**.md' - '.gitignore' - - '.github/**' + - '.github/workflows/**' + - 'LICENSE' jobs: auto-tag: @@ -19,6 +20,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} - name: Get latest tag id: get_latest_tag @@ -38,5 +40,7 @@ jobs: - name: Create new tag run: | 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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47d5628..f7576e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,35 +7,10 @@ on: permissions: contents: write + packages: 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 + goreleaser: runs-on: ubuntu-latest steps: - name: Checkout @@ -48,15 +23,6 @@ jobs: 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 @@ -66,56 +32,3 @@ jobs: 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