fix CI access #3
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: Build and Release | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| actions: write | |
| packages: write | |
| pull-requests: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-release: | |
| name: Build and Release (${{ matrix.platform }}) | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [macos-latest, ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.21" | |
| - name: Cache Go modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('src-tauri/go-backend/go.sum', 'src-tauri/go-backend/go.mod') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "./src-tauri -> target" | |
| - name: Install dependencies (Ubuntu only) | |
| if: matrix.platform == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Install Go backend dependencies | |
| working-directory: src-tauri/go-backend | |
| run: go mod download | |
| - name: Make build script executable (Unix only) | |
| if: matrix.platform != 'windows-latest' | |
| working-directory: src-tauri/go-backend | |
| run: chmod +x build.sh | |
| - name: Get version | |
| id: get_version | |
| shell: bash | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "VERSION=v$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: v$VERSION" | |
| - name: Delete existing draft release | |
| if: github.ref == 'refs/heads/main' && matrix.platform == 'macos-latest' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION="v$(node -p "require('./package.json').version")" | |
| echo "Checking for existing release with tag: $VERSION" | |
| # Get release ID if it exists | |
| RELEASE_ID=$(gh api repos/${{ github.repository }}/releases --jq ".[] | select(.tag_name == \"$VERSION\") | .id" || echo "") | |
| if [ -n "$RELEASE_ID" ]; then | |
| echo "Found existing release with ID: $RELEASE_ID" | |
| echo "Deleting existing release..." | |
| gh api -X DELETE repos/${{ github.repository }}/releases/$RELEASE_ID || echo "Failed to delete release" | |
| # Also delete the tag if it exists | |
| echo "Deleting tag: $VERSION" | |
| git push --delete origin $VERSION || echo "Tag does not exist or failed to delete" | |
| else | |
| echo "No existing release found" | |
| fi | |
| # Wait a bit for GitHub to process the deletion | |
| sleep 5 | |
| - name: Build and Release (Main branch) | |
| if: github.ref == 'refs/heads/main' | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: ${{ steps.get_version.outputs.VERSION }} | |
| releaseName: "S3 Deck ${{ steps.get_version.outputs.VERSION }}" | |
| releaseBody: | | |
| ## 🚀 S3 Deck ${{ steps.get_version.outputs.VERSION }} | |
| Auto-generated release from main branch. | |
| ## 📦 Downloads | |
| Choose the appropriate file for your platform: | |
| ### Windows | |
| - `S3Deck_*_x64_en-US.msi` - Windows Installer | |
| - `S3Deck.exe` - Portable executable | |
| ### macOS | |
| - `S3Deck_*_aarch64.dmg` - Apple Silicon (M1/M2/M3) | |
| - `S3Deck_*_x64.dmg` - Intel Macs | |
| ### Linux | |
| - `S3Deck_*_amd64.AppImage` - AppImage (Universal) | |
| - `S3Deck_*_amd64.deb` - Debian/Ubuntu package | |
| ## 🔧 What's New | |
| - Cross-platform S3 bucket management | |
| - Drag & drop file uploads with progress tracking | |
| - Dark/Light mode support | |
| - Multi-bucket configuration | |
| - Real-time file browser | |
| - Upload error handling and retry | |
| releaseDraft: false | |
| prerelease: false | |
| includeUpdaterJson: false |