change permissions for src-tauri to make it work locally #57
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: | |
| branches: | |
| - release/* | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| release: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check Release Exists | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| VERSION=$(jq -r '.version' src-tauri/tauri.conf.json) | |
| echo "Releasing version: $VERSION" | |
| if gh release view "v$VERSION" > /dev/null 2>&1; then | |
| echo "Release $VERSION already exists!" | |
| exit 1 | |
| fi | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install dependencies (Linux only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Install Node Modules | |
| run: npm install | |
| - name: Build Huly Browser | |
| uses: tauri-apps/tauri-action@v0 | |
| id: tauri-build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: v__VERSION__ | |
| releaseName: 'Huly Browser v__VERSION__' | |
| releaseBody: 'See the assets to download this version and install.' | |
| releaseDraft: false | |
| prerelease: false | |
| - name: Upload additional artifacts | |
| if: matrix.os == 'windows-latest' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| VERSION=$(jq -r '.version' src-tauri/tauri.conf.json) | |
| mv src-tauri/target/release/huly-browser.exe src-tauri/target/release/huly-browser-${VERSION}.exe | |
| if gh release view "v$VERSION" > /dev/null 2>&1; then | |
| gh release upload "v$VERSION" src-tauri/target/release/huly-browser-${VERSION}.exe | |
| else | |
| gh release create "v$VERSION" \ | |
| --title "Huly Browser v$VERSION" \ | |
| src-tauri/target/release/huly-browser-${VERSION}.exe | |
| fi | |
| release-macos: | |
| permissions: | |
| contents: write | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - args: "--target aarch64-apple-darwin" | |
| - args: "--target x86_64-apple-darwin" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check Release Exists | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| VERSION=$(jq -r '.version' src-tauri/tauri.conf.json) | |
| echo "Releasing version: $VERSION" | |
| if gh release view "v$VERSION" > /dev/null 2>&1; then | |
| echo "Release $VERSION already exists!" | |
| exit 1 | |
| fi | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install Node Modules | |
| run: npm install | |
| - name: Install Rust Targets | |
| run: | | |
| rustup target add aarch64-apple-darwin | |
| rustup target add x86_64-apple-darwin | |
| - name: Import Apple Developer Certificate | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| run: | | |
| echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12 | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
| security default-keychain -s build.keychain | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | |
| security set-keychain-settings -t 3600 -u build.keychain | |
| security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain | |
| security find-identity -v -p codesigning build.keychain | |
| - name: Verify Certificate | |
| run: | | |
| CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep -E "(Apple Development|Developer ID|Apple Distribution)" | head -1) | |
| CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}') | |
| echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV | |
| echo "Certificate imported." | |
| - name: decode API key to file | |
| env: | |
| APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }} | |
| run: | | |
| API_KEY_PATH=$PWD/privatekey.p8 | |
| echo "$APPLE_API_KEY_BASE64" | base64 --decode > $API_KEY_PATH | |
| echo "APPLE_API_KEY_PATH=$API_KEY_PATH" >> $GITHUB_ENV | |
| - name: Build Huly Browser | |
| uses: tauri-apps/tauri-action@v0 | |
| id: tauri-build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }} | |
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
| APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | |
| APPLE_API_KEY_PATH: ${{ env.APPLE_API_KEY_PATH }} | |
| with: | |
| tagName: v__VERSION__ | |
| releaseName: 'Huly Browser v__VERSION__' | |
| releaseBody: 'See the assets to download this version and install.' | |
| releaseDraft: false | |
| prerelease: false | |
| args: ${{ matrix.args }} |