Skip to content

Publish stytch-android #8

Publish stytch-android

Publish stytch-android #8

Workflow file for this run

name: Publish stytch-android
on:
push:
branches: [main]
workflow_dispatch:
jobs:
check:
name: Check versions and tags
runs-on: ubuntu-latest
outputs:
tag_exists: ${{ steps.tags.outputs.tag_exists }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- name: Get current version
id: version
env:
STYTCH_PUBLIC_TOKEN: 'abc123'
GOOGLE_OAUTH_CLIENT_ID: 'abc123'
STYTCH_B2B_PUBLIC_TOKEN: 'abc123'
STYTCH_B2B_ORG_ID: 'abc123'
PASSKEYS_DOMAIN: 'abc123'
UI_GOOGLE_CLIENT_ID: 'abc123'
run: |
VERSION=$(./gradlew -q printVersion)
echo "Found version $VERSION"
echo "this_version=$VERSION" >> $GITHUB_OUTPUT
- name: Check if tag exists
id: tags
run: |
git fetch --tags
echo "Checking for tags matching ${{ steps.version.outputs.this_version }}"
TAG_EXISTS=false
if [ $(git tag -l "${{ steps.version.outputs.this_version }}") ]; then
TAG_EXISTS=true
fi
echo "Tag exists = $TAG_EXISTS"
echo "tag_exists=$TAG_EXISTS" >> $GITHUB_OUTPUT
publish:
name: Release build and publish
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.tag_exists == 'false'
env:
STYTCH_PUBLIC_TOKEN: 'abc123'
GOOGLE_OAUTH_CLIENT_ID: 'abc123'
STYTCH_B2B_PUBLIC_TOKEN: 'abc123'
STYTCH_B2B_ORG_ID: 'abc123'
PASSKEYS_DOMAIN: 'abc123'
UI_GOOGLE_CLIENT_ID: 'abc123'
steps:
- name: Do it
run: echo "do the publish job"