Skip to content

Commit

Permalink
Merge pull request #27 from candlefinance/fix-release-parametrization
Browse files Browse the repository at this point in the history
Fix release parametrization
  • Loading branch information
nikwotton authored Jun 3, 2024
2 parents 8c412e5 + 044d462 commit bbce3e6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
13 changes: 9 additions & 4 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Setup
description: Setup Node.js and install dependencies

inputs:
workingDirectory:
required: true
type: string

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: packages/npm/send/.nvmrc
node-version-file: ${{ inputs.workingDirectory }}/.nvmrc

- name: Set up Git
shell: bash
Expand All @@ -20,8 +25,8 @@ runs:
uses: actions/cache@v3
with:
path: |
packages/npm/send/**/node_modules
packages/npm/send/.yarn/install-state.gz
${{ inputs.workingDirectory }}/**/node_modules
${{ inputs.workingDirectory }}/.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
Expand All @@ -30,5 +35,5 @@ runs:
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
working-directory: packages/npm/send
working-directory: ${{ inputs.workingDirectory }}
shell: bash
13 changes: 9 additions & 4 deletions .github/workflows/release_shared.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Release

on:
push:
branches:
- main
workflow_call:
inputs:
workingDirectory:
required: true
type: string

jobs:
release:
Expand All @@ -11,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "packages/npm/send"
working-directory: ${{ inputs.workingDirectory }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -21,6 +24,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
workingDirectory: ${{ inputs.workingDirectory }}

- name: Initialize the Npm Config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Test

on:
pull_request:
branches:
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/tests_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
workingDirectory: ${{ inputs.workingDirectory }}

- name: Lint files
run: yarn lint
Expand All @@ -37,6 +39,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
workingDirectory: ${{ inputs.workingDirectory }}

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage
Expand All @@ -52,6 +56,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
workingDirectory: ${{ inputs.workingDirectory }}

- name: Build package
run: yarn prepare
Expand All @@ -69,6 +75,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
workingDirectory: ${{ inputs.workingDirectory }}

- name: Cache turborepo for Android
uses: actions/cache@v3
Expand All @@ -87,19 +95,16 @@ jobs:
fi
- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
Expand Down Expand Up @@ -128,6 +133,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
workingDirectory: ${{ inputs.workingDirectory }}

- name: Cache turborepo for iOS
uses: actions/cache@v3
Expand All @@ -146,7 +153,6 @@ jobs:
fi
- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
uses: actions/cache@v3
with:
Expand All @@ -157,7 +163,6 @@ jobs:
${{ runner.os }}-cocoapods-
- name: Install cocoapods
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example/ios
pod install
Expand Down

0 comments on commit bbce3e6

Please sign in to comment.