-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (33 loc) · 1.1 KB
/
prerelease-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 }}