Skip to content

use react context instead of use-context-selector and implement canary release #1

use react context instead of use-context-selector and implement canary release

use react context instead of use-context-selector and implement canary release #1

# This is a basic workflow to help you get started with Actions
name: Canary release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the develop branch
on:
pull_request:
branches:
- develop
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Publish-and-release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get current time
uses: josStorer/get-current-time@v2.0.2
id: current_time
with:
format: YYYYMMDD-HH
utcOffset: '+01:00'
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Checkout the repo
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
# Get commit message
- name: Print head git commit message
id: get_head_commit_message
run: echo "::set-output name=HEAD_COMMIT_MESSAGE::$(git show -s --format=%s)"
- uses: actions/setup-node@v3
with:
node-version: 20.11.0
- name: Installing modules
id: install_modules
run: |
yarn cache clean
rm -rf node_modules
yarn install
- name: Running tests
id: tests
run: yarn test:ci
- name: Build
id: build
run: yarn build
- name: Bump version with timestamp and canary tag
run: |
TIMESTAMP=$(date +"%Y%m%d%H%M%S")
npm version prerelease --preid=canary.$TIMESTAMP
- name: Publish to NPM
id: npm_publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: canary
access: public