-
-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: make ios to a re-usable workflow * refactor: make android to a re-usable workflow * feat: set-up worflow on push with all actions * fix: pass secrets correctly to other workflow * fix: define required input type * chore: changelog * refactor: change to correct branch when merged
- Loading branch information
Showing
4 changed files
with
107 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
name: Android Build (Publish) | ||
on: [push] | ||
name: Android Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
NVMRC: | ||
required: true | ||
type: string | ||
secrets: | ||
MAPBOX_ACCESS_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
test: | ||
build_example: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup node ${{ inputs.NVMRC }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- run: yarn install --network-timeout 1000000 | ||
- run: yarn run unittest | ||
- run: yarn run generate | ||
node-version: ${{ inputs.NVMRC }} | ||
|
||
- name: set up JDK zulu 11 | ||
- name: Setup JDK zulu 11 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: "zulu" | ||
java-version: "11" | ||
distribution: 'zulu' | ||
java-version: '11' | ||
|
||
- run: echo $MAPBOX_ACCESS_TOKEN > ./accesstoken | ||
working-directory: example | ||
|
@@ -33,17 +38,3 @@ jobs: | |
|
||
- run: ./gradlew assemble | ||
working-directory: example/android | ||
|
||
publish: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm install --force && npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
name: iOS Build & Detox | ||
|
||
on: [push] | ||
on: | ||
workflow_call: | ||
inputs: | ||
NVMRC: | ||
required: true | ||
type: string | ||
secrets: | ||
MAPBOX_ACCESS_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
timeout-minutes: 25 | ||
|
||
defaults: | ||
run: | ||
working-directory: ./example | ||
|
@@ -19,10 +28,10 @@ jobs: | |
env: | ||
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | ||
|
||
- name: Install Node | ||
- name: Setup node ${{ inputs.NVMRC }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: "14" | ||
node-version: ${{ inputs.NVMRC }} | ||
|
||
- name: Install Yarn Dependencies | ||
run: yarn install --network-timeout 1000000 | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: On Push | ||
on: [push] | ||
|
||
jobs: | ||
lint_test_generate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Read .nvmrc | ||
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | ||
id: nvm | ||
|
||
- name: Setup node ${{ steps.nvm.outputs.NVMRC }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ steps.nvm.outputs.NVMRC }} | ||
|
||
- name: Install | ||
run: yarn install --network-timeout 1000000 | ||
|
||
- name: Lint | ||
run: yarn run lint | ||
|
||
- name: Test | ||
run: yarn run unittest | ||
|
||
- name: Generate | ||
run: yarn run generate | ||
|
||
outputs: | ||
NVMRC: ${{ steps.nvm.outputs.NVMRC }} | ||
|
||
call_android_workflow: | ||
needs: lint_test_generate | ||
uses: react-native-mapbox-gl/maps/.github/workflows/android-actions.yml@master | ||
with: | ||
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }} | ||
secrets: | ||
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | ||
|
||
|
||
call_ios_workflow: | ||
needs: lint_test_generate | ||
uses: react-native-mapbox-gl/maps/.github/workflows/ios-actions.yml@master | ||
with: | ||
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }} | ||
secrets: | ||
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | ||
|
||
publish: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: [lint_test_generate, call_android_workflow, call_ios_workflow] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup node ${{ steps.nvm.outputs.NVMRC }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ needs.lint_test_generate.outputs.NVMRC }} | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Install and Publish | ||
run: npm install --force && npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |
This file contains 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