diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9afff9ee95..7054798078 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,8 +6,40 @@ on: - "v*.*.*" jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v3 + with: + version: 9.9.0 + + - name: Cache turbo build + uses: actions/cache@v4 + with: + path: .turbo + key: turbo-${{ github.sha }} + restore-keys: | + turbo- + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: 20.18.0 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Build project + working-directory: apps/desktop + run: pnpm turbo build + create-draft-release: runs-on: ubuntu-latest + needs: build environment: "Production – umami-v2" permissions: contents: write @@ -23,9 +55,9 @@ jobs: create-release-linux: runs-on: ubuntu-latest - needs: create-draft-release + needs: [build, create-draft-release] permissions: - contents: write + contents: write environment: "Production – umami-v2" steps: - name: Check out code @@ -44,8 +76,17 @@ jobs: - name: Install dependencies run: pnpm install - - name: Build - run: pnpm build + - name: Cache turbo build + uses: actions/cache@v4 + with: + path: .turbo + key: turbo-${{ github.sha }} + restore-keys: | + turbo- + + - name: Build project + working-directory: apps/desktop + run: pnpm turbo build - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v6 @@ -57,7 +98,9 @@ jobs: - name: Generate deb and rpm files working-directory: apps/desktop - run: CI=false pnpm electron:package:linux -p never + env: + CI: false + run: pnpm electron:package:linux -p never - name: Sign the deb and rpm files using dpkg-sig and rpm-sign working-directory: apps/desktop @@ -69,13 +112,13 @@ jobs: - name: Upload deb and rpm files working-directory: apps/desktop - run: gh release upload ${{ github.ref_name }} ./dist/*.deb ./dist/*.rpm env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ github.ref_name }} ./dist/*.deb ./dist/*.rpm create-release-mac: runs-on: macos-latest - needs: create-draft-release + needs: [build, create-draft-release] environment: "Production – umami-v2" permissions: contents: write @@ -96,8 +139,17 @@ jobs: - name: Install dependencies run: pnpm install - - name: Build - run: pnpm build + - name: Cache turbo build + uses: actions/cache@v4 + with: + path: .turbo + key: turbo-${{ github.sha }} + restore-keys: | + turbo- + + - name: Build project + working-directory: apps/desktop + run: pnpm turbo build - name: Build and sign mac app working-directory: apps/desktop