Skip to content

Commit

Permalink
github dispatch test with input options
Browse files Browse the repository at this point in the history
  • Loading branch information
carlpoole committed Aug 28, 2021
1 parent d88da11 commit eef0bec
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ jobs:
node_modules
*/node_modules
key: dependency-cache-${{ hashFiles('package.json', '*/package.json') }}
env:
CAPACITOR_VERSION: 3.2.0
- run: npm install
- run: npm run verify:android
working-directory: ${{ matrix.plugin }}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/publish-android.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Publish Native Android Libraries

on: workflow_dispatch
# push:
# branches: [ publish-android ]

on:
workflow_dispatch:
inputs:
plugins:
description: 'Specify an optional subset of plugins to publish (space delimited)'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -12,6 +15,8 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v2
with:
ref: publish-android
- name: set up JDK 11
uses: actions/setup-java@v2
with:
Expand All @@ -22,6 +27,7 @@ jobs:
- name: Run publish script
working-directory: ./scripts
env:
GITHUB_PLUGINS: ${{ github.event.inputs.plugins }}
ANDROID_OSSRH_USERNAME: ${{ secrets.ANDROID_OSSRH_USERNAME }}
ANDROID_OSSRH_PASSWORD: ${{ secrets.ANDROID_OSSRH_PASSWORD }}
ANDROID_SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }}
Expand Down
27 changes: 17 additions & 10 deletions scripts/publish-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,25 @@ else
# Capacitor version in MavenCentral is up to date, continue publishing the native Capacitor Plugins
printf %"s\n\n" "Latest native Capacitor Android library is version $CAPACITOR_PUBLISHED_VERSION and is up to date, continuing with plugin publishing..."

# If run without args, process all plugins, else run over the plugins provided as args
if [ "$#" -eq "0" ]
then
# Run publish task for all plugins
for f in "$DIR"/*; do
publish_plugin $f
done
else
# Run publish task for plugins provided as arguments
for var in "$@"; do
# Check if github actions passing in a custom list of plugins
if [[ $GITHUB_PLUGINS ]]; then
for var in ${GITHUB_PLUGINS[@]}; do
PLUGIN_DIR="$DIR"/$var
publish_plugin $PLUGIN_DIR
done
else
# If run without .sh args, process all plugins, else run over the plugins provided as args
if [[ "$#" -eq "0" ]]; then
# Run publish task for all plugins
for f in "$DIR"/*; do
publish_plugin $f
done
else
# Run publish task for plugins provided as arguments
for var in "$@"; do
PLUGIN_DIR="$DIR"/$var
publish_plugin $PLUGIN_DIR
done
fi
fi
fi

0 comments on commit eef0bec

Please sign in to comment.