Skip to content

Merge pull request #308 from tangem/release-app_4.9 #278

Merge pull request #308 from tangem/release-app_4.9

Merge pull request #308 from tangem/release-app_4.9 #278

Workflow file for this run

name: Neutral Build
on:
push:
branches:
- 'release/**'
- 'develop'
workflow_dispatch:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DVELOPMENT_ANDROID }}
jobs:
tag:
name: Create tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Create tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.extract_branch.outputs.branch }}-${{ github.run_number }}",
sha: context.sha
})
- name: Build and publish
run: |
echo sdk.dir = $ANDROID_HOME > local.properties
./gradlew -PnexusUser=${{ secrets.NEXUS_USERNAME }} -PnexusPass=${{ secrets.NEXUS_PASSWORD }} -PartifactVersion=${{ steps.extract_branch.outputs.branch }}-${{ github.run_number }} publish
- name: Build notification
if: always()
uses: adamkdean/simple-slack-notify@master
with:
channel: '#development-android'
status: ${{ job.status }}
success_text: 'Card SDK build (${{ steps.extract_branch.outputs.branch }}-${{ github.run_number }}) has been created and uploaded to Nexus.'
failure_text: 'GitHub Action #${{ github.run_number }} failed. Tag has not been not created.'
cancelled_text: 'GitHub Action #${{ github.run_number }} was cancelled'
fields: |
[{"title": "TAG", "value": "${{ steps.extract_branch.outputs.branch }}-${{ github.run_number }}"},
{"title": "Action URL", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}]