Skip to content

Automated binary release #146

Automated binary release

Automated binary release #146

# This workflow will release project with Gradle
name: Automated binary release
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * 5'
workflow_dispatch:
inputs:
scope:
description: 'Specify scope that is to be used.'
required: true
type: choice
options:
- patch
- minor
- major
default: 'patch'
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
- uses: ./.github/actions/setup
- name: Build with Gradle
run: ./gradlew clean build
- name: Clean git
run: git reset --hard HEAD
- name: Set email
run: git config user.email "[email protected]"
- name: Set name
run: git config user.name "Zowe Robot"
- name: Release to NPM automatic
run: |
cd onboarding-enabler-nodejs
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
echo "registry=$DIST_REGISTRY" >> ~/.npmrc
npm version ${{ github.event.inputs.scope || env.DEFAULT_SCOPE }}
npm publish --access public
git add package.json
git commit -m "[skip ci] Update version"
git push
cd ..
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
DEFAULT_SCOPE: 'patch'
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DIST_REGISTRY: https://registry.npmjs.org/
- name: Release with Gradle automatic
run: ./gradlew release -x test -x checkstyleTest -Prelease.useAutomaticVersion=true -Prelease.scope=${{ github.event.inputs.scope || env.DEFAULT_SCOPE }} -Pzowe.deploy.username=$ARTIFACTORY_USERNAME -Pzowe.deploy.password=$ARTIFACTORY_PASSWORD -Partifactory_user=$ARTIFACTORY_USERNAME -Partifactory_password=$ARTIFACTORY_USERNAME
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
DEFAULT_SCOPE: 'patch'
BUILD_NUMBER: ${{ github.run_number }}
BRANCH_NAME: ${{ github.ref_name }}
- uses: ./.github/actions/teardown