|
| 1 | +name: 'Publish Pre-Release' |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*-beta*' |
| 7 | + - 'v*-alpha*' |
| 8 | + - 'v*-rc*' |
| 9 | + |
| 10 | +jobs: |
| 11 | + publish-tauri-prerelease: |
| 12 | + permissions: |
| 13 | + contents: write |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + - platform: 'macos-latest' |
| 19 | + args: '--target aarch64-apple-darwin' |
| 20 | + - platform: 'macos-latest' |
| 21 | + args: '--target x86_64-apple-darwin' |
| 22 | + - platform: 'ubuntu-latest' |
| 23 | + args: '' |
| 24 | + - platform: 'windows-latest' |
| 25 | + args: '--target x86_64-pc-windows-msvc' |
| 26 | + |
| 27 | + runs-on: ${{ matrix.platform }} |
| 28 | + steps: |
| 29 | + - name: Checkout repository |
| 30 | + uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: Install dependencies (ubuntu only) |
| 33 | + if: matrix.platform == 'ubuntu-latest' |
| 34 | + run: | |
| 35 | + sudo apt-get update |
| 36 | + sudo apt-get install -y \ |
| 37 | + build-essential \ |
| 38 | + curl \ |
| 39 | + wget \ |
| 40 | + file \ |
| 41 | + pkg-config \ |
| 42 | + libglib2.0-dev \ |
| 43 | + libwebkit2gtk-4.1-dev \ |
| 44 | + libssl-dev \ |
| 45 | + libayatana-appindicator3-dev \ |
| 46 | + librsvg2-dev \ |
| 47 | + patchelf |
| 48 | +
|
| 49 | + - name: Set PKG_CONFIG_PATH for Linux |
| 50 | + if: matrix.platform == 'ubuntu-latest' |
| 51 | + run: | |
| 52 | + echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:${PKG_CONFIG_PATH}" >> $GITHUB_ENV |
| 53 | +
|
| 54 | + - name: Setup Rust |
| 55 | + uses: dtolnay/rust-toolchain@stable |
| 56 | + with: |
| 57 | + targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} |
| 58 | + |
| 59 | + - name: Cache Rust build |
| 60 | + uses: swatinem/rust-cache@v2 |
| 61 | + with: |
| 62 | + workspaces: './src-tauri -> target' |
| 63 | + |
| 64 | + - name: Setup Bun |
| 65 | + uses: oven-sh/setup-bun@v2 |
| 66 | + with: |
| 67 | + bun-version: latest |
| 68 | + |
| 69 | + - name: Install frontend dependencies |
| 70 | + run: bun install --frozen-lockfile |
| 71 | + |
| 72 | + - name: Set build environment variables |
| 73 | + shell: bash |
| 74 | + run: | |
| 75 | + echo "GIT_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 76 | + echo "GIT_BRANCH=${GITHUB_REF_NAME}" >> $GITHUB_ENV |
| 77 | + echo "BUILD_TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")" >> $GITHUB_ENV |
| 78 | +
|
| 79 | + - name: Determine pre-release type |
| 80 | + shell: bash |
| 81 | + run: | |
| 82 | + TAG_NAME=${GITHUB_REF_NAME} |
| 83 | + if [[ $TAG_NAME == *"alpha"* ]]; then |
| 84 | + echo "PRERELEASE_TYPE=Alpha" >> $GITHUB_ENV |
| 85 | + echo "PRERELEASE_EMOJI=🚧" >> $GITHUB_ENV |
| 86 | + echo "TAG_PREFIX=alpha" >> $GITHUB_ENV |
| 87 | + elif [[ $TAG_NAME == *"beta"* ]]; then |
| 88 | + echo "PRERELEASE_TYPE=Beta" >> $GITHUB_ENV |
| 89 | + echo "PRERELEASE_EMOJI=🧪" >> $GITHUB_ENV |
| 90 | + echo "TAG_PREFIX=beta" >> $GITHUB_ENV |
| 91 | + elif [[ $TAG_NAME == *"rc"* ]]; then |
| 92 | + echo "PRERELEASE_TYPE=Release Candidate" >> $GITHUB_ENV |
| 93 | + echo "PRERELEASE_EMOJI=🎯" >> $GITHUB_ENV |
| 94 | + echo "TAG_PREFIX=rc" >> $GITHUB_ENV |
| 95 | + else |
| 96 | + echo "PRERELEASE_TYPE=Pre-Release" >> $GITHUB_ENV |
| 97 | + echo "PRERELEASE_EMOJI=⚠️" >> $GITHUB_ENV |
| 98 | + echo "TAG_PREFIX=pre" >> $GITHUB_ENV |
| 99 | + fi |
| 100 | + |
| 101 | + # Extract version number from tag (e.g., v1.0.0-alpha.1 -> 1.0.0 and 1) |
| 102 | + BASE_VERSION=$(echo $TAG_NAME | sed -E 's/v([0-9]+\.[0-9]+\.[0-9]+)-.*/\1/') |
| 103 | + PRERELEASE_NUMBER=$(echo $TAG_NAME | sed -E 's/.*\.(.*)/\1/') |
| 104 | + echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV |
| 105 | + echo "PRERELEASE_NUMBER=$PRERELEASE_NUMBER" >> $GITHUB_ENV |
| 106 | +
|
| 107 | + - name: Build Tauri App |
| 108 | + uses: tauri-apps/tauri-action@v0 |
| 109 | + env: |
| 110 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 111 | + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} |
| 112 | + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} |
| 113 | + GIT_COMMIT_HASH: ${{ env.GIT_COMMIT_HASH }} |
| 114 | + GIT_BRANCH: ${{ env.GIT_BRANCH }} |
| 115 | + BUILD_TIMESTAMP: ${{ env.BUILD_TIMESTAMP }} |
| 116 | + with: |
| 117 | + tagName: ${{ github.ref_name }} |
| 118 | + releaseName: '${{ env.PRERELEASE_EMOJI }} OBS Sync ${{ github.ref_name }}' |
| 119 | + releaseBody: | |
| 120 | + ## ${{ env.PRERELEASE_EMOJI }} Pre-Release: ${{ env.PRERELEASE_TYPE }} |
| 121 | + |
| 122 | + **⚠️ This is a pre-release version intended for testing purposes.** |
| 123 | + |
| 124 | + ### What's New in This Pre-Release |
| 125 | + - Auto-generated pre-release from GitHub Actions |
| 126 | + - Built from commit: ${{ env.GIT_COMMIT_HASH }} |
| 127 | + - Branch: ${{ env.GIT_BRANCH }} |
| 128 | + - Build time: ${{ env.BUILD_TIMESTAMP }} |
| 129 | + |
| 130 | + ### Important Notes |
| 131 | + - ⚠️ **Use at your own risk**: This version may contain bugs or unstable features |
| 132 | + - 🧪 **For testing only**: Not recommended for production use |
| 133 | + - 📝 **Feedback welcome**: Please report issues on GitHub |
| 134 | + - 🔄 **Auto-update**: This version supports automatic updates to newer pre-releases and stable releases |
| 135 | + |
| 136 | + ### Download Instructions |
| 137 | + Select the appropriate installer for your platform: |
| 138 | + - **Windows**: `.msi` file |
| 139 | + - **macOS**: `.dmg` file |
| 140 | + - **Linux**: `.AppImage` or `.deb` file |
| 141 | + |
| 142 | + ### How to Help |
| 143 | + 1. Download and test this pre-release |
| 144 | + 2. Report any issues you encounter |
| 145 | + 3. Provide feedback on new features |
| 146 | + 4. Help us make the stable release better! |
| 147 | + |
| 148 | + --- |
| 149 | + 📋 **Full changelog and stable releases**: [View all releases](https://github.com/${{ github.repository }}/releases) |
| 150 | + releaseDraft: false |
| 151 | + prerelease: true |
| 152 | + includeUpdaterJson: true |
| 153 | + args: ${{ matrix.args }} |
0 commit comments