Publish for Android and iOS on release branch #36
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
name: Publish to artifactory on release branch | |
on: | |
push: | |
branches: [ "release" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macos-latest | |
permissions: | |
contents: write # needed for tagging and creating release | |
id-token: write | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
steps: | |
- name: "Setup Java" | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Expose version for creating release | |
run: ./gradlew assemble --no-configuration-cache #&& echo "VERSION=$( ./gradlew :getVersion --no-configuration-cache)" >> $GITHUB_ENV | |
- name: "Checkout sources" | |
uses: actions/checkout@v4 | |
- name: Create tag | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/${{ env.VERSION }}', | |
sha: context.sha | |
}) | |
- name: release | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
release_name: ${{ steps.version.outputs.version }} | |
tag_name: ${{ env.VERSION }} | |
body: "Release ${{ env.VERSION }}" | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
# Populates ARTIFACTORY_USERNAME and ARTIFACTORY_API_KEY with | |
# temporary username/password for publishing to packages.atlassian.com | |
- name: Get publish token | |
id: publish-token | |
uses: atlassian-labs/[email protected] | |
with: | |
output-modes: environment | |
# Publishes to Artifactory only on push to the "release" branch. | |
#- name: "Publish" | |
# run: ./gradlew assemble --no-configuration-cache && ./gradlew publish --no-configuration-cache --stacktrace |