Skip to content

Publish for Android and iOS on release branch #32

Publish for Android and iOS on release branch

Publish for Android and iOS on release branch #32

Workflow file for this run

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: Expose version for creating release
run: echo "VERSION=$( ./gradlew :getVersion )" >> $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 }}
- name: "Setup Java"
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
# 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