-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from stytchauth/jordan/auto-publish
Setup autopublish workflow
- Loading branch information
Showing
3 changed files
with
80 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Publish stytch-android | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check: | ||
name: Check versions and tags | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag_exists: ${{ steps.tags.outputs.tag_exists }} | ||
this_version: ${{ steps.version.outputs.this_version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version: 17 | ||
cache: 'gradle' | ||
- 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 | ||
needs: check | ||
if: needs.check.outputs.tag_exists == 'false' | ||
uses: stytchauth/stytch-android/.github/workflows/publish.yml@main | ||
tag-and-release: | ||
name: Create tag and release | ||
runs-on: ubuntu-latest | ||
needs: check | ||
if: needs.check.outputs.tag_exists == 'false' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Create Tag | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git tag -a "${{needs.check.outputs.this_version}}" -m "${{needs.check.outputs.this_version}}" | ||
git push --follow-tags | ||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh release create "${{needs.check.outputs.this_version}}" --generate-notes | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/publishHeadless.yml → .github/workflows/publish.yml
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,4 +1,4 @@ | ||
name: Publish Headless SDK | ||
name: Publish SDK | ||
|
||
on: | ||
workflow_dispatch: | ||
|
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