chore: bump version to 0.2.0 #4
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| release-macos: | |
| name: Release macOS (${{ matrix.arch_label }}) | |
| runs-on: macos-latest | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch_label: Apple Silicon | |
| rust_target: aarch64-apple-darwin | |
| - arch_label: Intel | |
| rust_target: x86_64-apple-darwin | |
| env: | |
| CI: true | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin,x86_64-apple-darwin | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Validate release version | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME#v}" | |
| PACKAGE_VERSION="$(node -p "require('./package.json').version")" | |
| TAURI_VERSION="$(node -p "require('./src-tauri/tauri.conf.json').version")" | |
| CARGO_VERSION="$(node -e "const fs=require('fs'); const match=fs.readFileSync('src-tauri/Cargo.toml','utf8').match(/^version = \"(.+)\"$/m); if (!match) process.exit(1); process.stdout.write(match[1]);")" | |
| if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ] || [ "$TAG_VERSION" != "$TAURI_VERSION" ] || [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then | |
| echo "Tag version: $TAG_VERSION" | |
| echo "package.json: $PACKAGE_VERSION" | |
| echo "tauri.conf.json:$TAURI_VERSION" | |
| echo "Cargo.toml: $CARGO_VERSION" | |
| echo "Version mismatch detected." | |
| exit 1 | |
| fi | |
| - name: Configure macOS signing mode | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| APPLE_SIGNING_IDENTITY_SECRET: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
| run: | | |
| if [ -n "$APPLE_CERTIFICATE" ] && [ -n "$APPLE_CERTIFICATE_PASSWORD" ]; then | |
| echo "Using Apple certificate secrets for signed builds." | |
| if [ -n "$APPLE_SIGNING_IDENTITY_SECRET" ]; then | |
| echo "APPLE_SIGNING_IDENTITY=$APPLE_SIGNING_IDENTITY_SECRET" >> "$GITHUB_ENV" | |
| fi | |
| else | |
| echo "No Apple certificate configured; using ad-hoc signing." | |
| echo "APPLE_SIGNING_IDENTITY=-" >> "$GITHUB_ENV" | |
| fi | |
| - name: Build and upload release artifacts | |
| uses: tauri-apps/tauri-action@v0.6 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| with: | |
| tagName: ${{ github.ref_name }} | |
| releaseName: codexs ${{ github.ref_name }} | |
| releaseBody: | | |
| Automated macOS release artifacts: | |
| - Apple Silicon (`aarch64-apple-darwin`) | |
| - Intel (`x86_64-apple-darwin`) | |
| Download the `.dmg` file that matches your Mac architecture. | |
| releaseDraft: false | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| args: --target ${{ matrix.rust_target }} | |
| releaseAssetNamePattern: "[name]_[version]_[arch][ext]" |