Skip to content

Commit

Permalink
Remove yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
rlepinski committed Nov 22, 2023
1 parent 75fd9ca commit 67c7f11
Show file tree
Hide file tree
Showing 11 changed files with 32,037 additions and 11,644 deletions.
59 changes: 10 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,23 @@ jobs:
android:
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_15.0.1.app/Contents/Developer'

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
shell: bash

- name: Run CI
run: bash ./scripts/run_ci_tasks.sh -a

ios:
runs-on: macos-13-xlarge
env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
steps:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'npm'

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
shell: bash

- name: Run CI
run: bash ./scripts/run_ci_tasks.sh -i
- run: npm ci
- run: bash ./scripts/run_ci_tasks.sh -a
- run: bash ./scripts/run_ci_tasks.sh -i
74 changes: 41 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,59 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Check Version
run: bash ./scripts/check_version.sh ${GITHUB_REF/refs\/tags\//}

deploy:
module:
needs: check-version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
always-auth: true
registry-url: 'https://registry.npmjs.org'

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

docs:
needs: check-version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version-file: .nvmrc
always-auth: true
registry-url: 'https://registry.npmjs.org'

- uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}


- run: npm ci
- run: npm run docs
- run: bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//}

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
shell: bash
github-release:
needs: check-version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get the version
id: get_version
Expand All @@ -55,22 +77,7 @@ jobs:
NOTES="${NOTES//$'\n'/'%0A'}"
NOTES="${NOTES//$'\r'/'%0D'}"
echo ::set-output name=NOTES::"$NOTES"
- name: Generate documentation
run: yarn docs

- uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}

- name: Upload docs
run: bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//}
- name: Publish modules
run: |
yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Github Release
uses: actions/[email protected]
env:
Expand All @@ -80,4 +87,5 @@ jobs:
release_name: ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.get_release_notes.outputs.NOTES }}
draft: false
prerelease: false
prerelease: false

3 changes: 0 additions & 3 deletions .yarnrc

This file was deleted.

52 changes: 7 additions & 45 deletions DEV_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,22 @@

The example is set up to reference the module using a yarn workspace.

1) Install yarn and watchman, if necessary
1) Setup

```
brew install yarn
```
Execute the following command in the root directory

```
brew install watchman
npm run bootstrap install
```

2) Install modules

Execute the following command in the root directory
2) Run Android

```
yarn install
npm run example android
```

3) Perform platform-specific setup

## iOS

1) Run `pod install --repo-update` in `example/ios`

2) Open the `example/ios/AirshipSample.xcworkspace` Project

3) Create the `AirshipConfig.plist` file

4) Start the webserver in the top-level directory by running `yarn start`

5) Build and run the sample in the `example` directory: `yarn run:ios`

You should now be able to modify the iOS plugin source
directly in the sample's workspace.

## Android

1) Open `example/android` in Android Studio

2) Create the `airshipconfig.properties` file in `example/android/app/src/main/assets`

3) If using FCM, add your `google-services.json` file in `example/android/app`

4) Start the webserver in the top-level directory by running `yarn start`

5) Build and run the sample in the `example` directory: `yarn run:android`

You should now be able to modify the Android plugin source directly in Android Studio.


4) JS unit tests

We have unit tests for the Javascript part of the module. To run the tests, execute the following command in the root directory:
2) Run iOS

```
yarn test
npm run example ios
```
Loading

0 comments on commit 67c7f11

Please sign in to comment.