Skip to content

Release

Release #100

Workflow file for this run

# Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# This is a basic workflow to help you get started with Actions
name: Release
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
Type:
description: 'Choose which version to bump before release'
required: true
default: 'patch'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
token: ${{secrets.ASGARDIO_GITHUB_BOT_TOKEN}}
if: github.repository == 'asgardeo/asgardeo-auth-js-core'
- uses: actions/checkout@v2
if: github.repository != 'asgardeo/asgardeo-auth-js-core'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Build
run: |
yarn install --frozen-lockfile
yarn build
- name: Bump Version
run: |
git config --global user.email "version.bump@github.action.com"
git config --global user.name "asgardeo-github-bot"
yarn run bump-${{ github.event.inputs.Type }}-version
git push --follow-tags
- name: Pack Release Artifacts
run: |
mkdir artifacts
if test -d samples
then
cd samples
rm -rf **/node_modules/
for dir in */ ; do
zip -r "../artifacts/${dir%/}.zip" $dir
done
fi
- name: Release Asgardeo Auth JS SDK
run: |
version=`git describe --tags --abbrev=0`
echo ${{secrets.ASGARDIO_GITHUB_BOT_TOKEN}} | gh auth login --with-token
if test -d samples
then
gh release create $version artifacts/*
else
gh release create $version
fi
- name: Publish Asgardeo Auth JS SDK
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
cp README.md lib
cd lib
npm publish --access public