release: v0.1.43 #40
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_name }} | |
| cancel-in-progress: false | |
| env: | |
| TURBO_TELEMETRY_DISABLED: 1 | |
| jobs: | |
| build-release: | |
| name: Build Release Artifacts | |
| runs-on: ${{ matrix.runner }} | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - id: linux-x64 | |
| runner: ubuntu-22.04 | |
| artifact_name: release-linux-x64 | |
| asset_prefix: x86_64 | |
| - id: macos-x64 | |
| runner: macos-15-intel | |
| artifact_name: release-macos-x64 | |
| asset_prefix: x86_64 | |
| - id: macos-arm64 | |
| runner: macos-14 | |
| artifact_name: release-macos-arm64 | |
| asset_prefix: aarch64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust build artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: apps/desktop/src-tauri -> target | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libgtk-3-dev \ | |
| libwebkit2gtk-4.1-dev \ | |
| libjavascriptcoregtk-4.1-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev \ | |
| libfuse2 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Verify release version metadata | |
| run: bash ./scripts/sync-aur-metadata.sh "${GITHUB_REF_NAME#v}" | |
| - name: Build sidecar artifacts | |
| run: bash ./scripts/build-sidecar.sh | |
| - name: Smoke test sidecar | |
| run: node ./scripts/smoke-test-sidecar.mjs | |
| - name: Build desktop | |
| run: | | |
| set -euo pipefail | |
| if [ "${{ runner.os }}" = "Linux" ]; then | |
| pnpm --filter @openlinear/desktop tauri build --ci --config '{"bundle":{"targets":["deb"]}}' | |
| else | |
| pnpm --filter @openlinear/desktop tauri build --ci --config '{"bundle":{"targets":["app"]}}' | |
| fi | |
| - name: Smoke test packaged Linux sidecar | |
| if: runner.os == 'Linux' | |
| run: | | |
| set -euo pipefail | |
| TMP_DIR=$(mktemp -d) | |
| trap 'rm -rf "$TMP_DIR"' EXIT | |
| PORTABLE_TARBALL="$TMP_DIR/openlinear-linux-x64.tar.gz" | |
| bash ./scripts/package-linux-portable.sh "${GITHUB_REF_NAME#v}" "$PORTABLE_TARBALL" | |
| tar -xzf "$PORTABLE_TARBALL" -C "$TMP_DIR" | |
| timeout 15s "$TMP_DIR/openlinear-linux-x64/openlinear-sidecar" > "$TMP_DIR/sidecar.log" 2>&1 || true | |
| cat "$TMP_DIR/sidecar.log" | |
| grep -q "Server running on http://localhost:3001" "$TMP_DIR/sidecar.log" | |
| - name: Prepare release artifacts | |
| run: | | |
| set -euo pipefail | |
| VERSION=${GITHUB_REF_NAME#v} | |
| mkdir -p dist/release | |
| if [ "${{ runner.os }}" = "Linux" ]; then | |
| DEB=$(ls apps/desktop/src-tauri/target/release/bundle/deb/*.deb | head -n 1) | |
| cp "$DEB" "dist/release/openlinear-${VERSION}-${{ matrix.asset_prefix }}.deb" | |
| bash ./scripts/package-linux-portable.sh "$VERSION" "dist/release/openlinear-${VERSION}-${{ matrix.asset_prefix }}-linux.tar.gz" | |
| else | |
| APP_DIR=$(find apps/desktop/src-tauri/target/release/bundle/macos -maxdepth 1 -type d -name '*.app' | head -n 1) | |
| APP_TARBALL="dist/release/openlinear-${VERSION}-${{ matrix.asset_prefix }}.app.tar.gz" | |
| DMG="dist/release/openlinear-${VERSION}-${{ matrix.asset_prefix }}.dmg" | |
| DMG_STAGING_DIR=$(mktemp -d) | |
| cp -R "$APP_DIR" "$DMG_STAGING_DIR/$(basename "$APP_DIR")" | |
| ln -s /Applications "$DMG_STAGING_DIR/Applications" | |
| hdiutil create -volname "OpenLinear" -srcfolder "$DMG_STAGING_DIR" -ov -format UDZO "$DMG" | |
| rm -rf "$DMG_STAGING_DIR" | |
| tar -C "$(dirname "$APP_DIR")" -czf "$APP_TARBALL" "$(basename "$APP_DIR")" | |
| fi | |
| - name: Upload release artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: dist/release/* | |
| create-release: | |
| name: Create GitHub release | |
| needs: build-release | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Download release artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist/release | |
| merge-multiple: true | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: dist/release/* | |
| publish-npm: | |
| name: Publish npm package | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Verify tag matches package version | |
| run: | | |
| set -euo pipefail | |
| VERSION=${GITHUB_REF_NAME#v} | |
| PACKAGE_VERSION=$(node -p "require('./packages/openlinear/package.json').version") | |
| if [ "$VERSION" != "$PACKAGE_VERSION" ]; then | |
| echo "Tag version $VERSION does not match packages/openlinear/package.json version $PACKAGE_VERSION" >&2 | |
| exit 1 | |
| fi | |
| - name: Publish openlinear | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| cd packages/openlinear | |
| LOCAL_VERSION=$(node -p "require('./package.json').version") | |
| REMOTE_VERSION=$(npm view openlinear version 2>/dev/null || echo "0.0.0") | |
| if [ "$LOCAL_VERSION" = "$REMOTE_VERSION" ]; then | |
| echo "Version $LOCAL_VERSION already published, skipping" | |
| exit 0 | |
| fi | |
| npm publish --access public --provenance | |
| publish-aur: | |
| name: Publish Arch package metadata | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Sync Arch package metadata | |
| run: bash ./scripts/sync-aur-metadata.sh "${GITHUB_REF_NAME#v}" | |
| - name: Publish to AUR | |
| uses: KSXGitHub/github-actions-deploy-aur@v3.0.1 | |
| with: | |
| pkgname: openlinear-bin | |
| pkgbuild: packaging/aur/openlinear-bin/PKGBUILD | |
| assets: | | |
| packaging/aur/openlinear-bin/.SRCINFO | |
| packaging/aur/openlinear-bin/openlinear.desktop | |
| commit_username: kaizen403 | |
| commit_email: kaizen403@proton.me | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: "Update to ${{ github.ref_name }}" |