Skip to content

Manually Publish Pre-release #13

Manually Publish Pre-release

Manually Publish Pre-release #13

name: Manually Publish Pre-release
on:
workflow_dispatch:
inputs:
branch_or_tag:
description: 'Select a branch or tag'
required: true
default: 'sdk7'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Determine commit hash
id: commit_hash
run: echo "::set-output name=commit_hash::$(git rev-parse HEAD)"
- name: Create Git Tag
id: create_tag
run: |
tag_name="v${{ github.run_number }}"
git tag $tag_name ${{ steps.commit_hash.outputs.commit_hash }}
echo "::set-output name=tag_name::$tag_name"
- name: Push Tag to GitHub
run: git push origin ${{ steps.create_tag.outputs.tag_name }}
- name: Set Package Version
run: |
tag_name="${{ steps.create_tag.outputs.tag_name }}"
echo "{\"version\":\"$tag_name\"}" > package.json
- name: Publish to NPM
run: npm publish --tag ${{ steps.create_tag.outputs.tag_name }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}