Skip to content

Commit

Permalink
Fixed workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Aug 8, 2024
1 parent 1f3d43b commit eec748a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ name: "Build and cache zomes"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-cache-zomes:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

Expand All @@ -26,22 +32,27 @@ jobs:
run: |
nix develop --no-update-lock-file --accept-flake-config --command bash -c "pnpm i && pnpm t && pnpm -F @holochain-open-dev/{{kebab_case app_name}} build"

- name: Build zomes
- name: Build debug zomes
env:
CACHIX_AUTH_TOKEN: "$\{{ secrets.CACHIX_TOKEN_HOLOCHAIN_OPEN_DEV }}"
run: |
cachix watch-exec holochain-open-dev -- nix build --no-update-lock-file --accept-flake-config -L .#{{snake_case app_name}}_integrity
cachix push holochain-open-dev $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}_integrity | nix run nixpkgs#jq -- -r '.[].path')
cachix pin holochain-open-dev tasks_integrity_debug $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}_integrity | nix run nixpkgs#jq -- -r '.[].path')

cachix watch-exec holochain-open-dev -- nix build --no-update-lock-file --accept-flake-config -L .#{{snake_case app_name}}_integrity.meta.release
cachix push holochain-open-dev $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}_integrity.meta.release | nix run nixpkgs#jq -- -r '.[].path')
cachix pin holochain-open-dev tasks_integrity $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}_integrity.meta.release | nix run nixpkgs#jq -- -r '.[].path')
cachix pin holochain-open-dev {{snake_case app_name}}_integrity_debug $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}_integrity | nix run nixpkgs#jq -- -r '.[].path')

cachix watch-exec holochain-open-dev -- nix build --no-update-lock-file --accept-flake-config -L .#{{snake_case app_name}}
cachix push holochain-open-dev $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}} | nix run nixpkgs#jq -- -r '.[].path')
cachix pin holochain-open-dev {{snake_case app_name}}_debug $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}} | nix run nixpkgs#jq -- -r '.[].path')

- name: Build release zomes
if: matrix.os == 'ubuntu-latest'
env:
CACHIX_AUTH_TOKEN: "$\{{ secrets.CACHIX_TOKEN_HOLOCHAIN_OPEN_DEV }}"
run: |
cachix watch-exec holochain-open-dev -- nix build --no-update-lock-file --accept-flake-config -L .#{{snake_case app_name}}_integrity.meta.release
cachix push holochain-open-dev $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}_integrity.meta.release | nix run nixpkgs#jq -- -r '.[].path')
cachix pin holochain-open-dev {{snake_case app_name}}_integrity $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}_integrity.meta.release | nix run nixpkgs#jq -- -r '.[].path')

cachix watch-exec holochain-open-dev -- nix build --no-update-lock-file --accept-flake-config -L .#{{snake_case app_name}}.meta.release
cachix push holochain-open-dev $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}.meta.release | nix run nixpkgs#jq -- -r '.[].path')
cachix pin holochain-open-dev {{snake_case app_name}} $(nix path-info --json --accept-flake-config --no-warn-dirty .#{{snake_case app_name}}.meta.release | nix run nixpkgs#jq -- -r '.[].path')
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:
if: steps.changes.outputs.flake_lock == 'true' || steps.changes.outputs.package_json == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PAT }}
token: $\{{ secrets.PAT }}

- name: Enable Pull Request Automerge
if: (steps.changes.outputs.flake_lock == 'true' || steps.changes.outputs.package_json == 'true') && steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.PAT }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
token: $\{{ secrets.PAT }}
pull-request-number: $\{{ steps.cpr.outputs.pull-request-number }}
merge-method: squash

0 comments on commit eec748a

Please sign in to comment.