Skip to content

Binary specific release #25

Binary specific release

Binary specific release #25

# This workflow will release project with Gradle
name: Binary specific release
on:
workflow_dispatch:
inputs:
release_version:
description: 'The version that is going to be release'
required: true
new_version:
description: 'The version that should be used as a new one after the release.'
required: true
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
- uses: ./.github/actions/setup
- name: Print npm version
run: npm -v
- name: Build with Gradle
run: ./gradlew 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.release_version }}
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 }}
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.releaseVersion=${{ github.event.inputs.release_version }} -Prelease.newVersion=${{ github.event.inputs.new_version }} -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 }}
- uses: ./.github/actions/teardown