-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.96 KB
/
publish.yaml
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
42
43
44
45
46
47
48
49
50
51
52
################################################################################
# DO NOT EDIT THIS FILE (Auto-Generated) - COPY IT! #
# #
# Contents of this file were generated by https://github.com/parcelLab/.github #
# Changes to this file may be overwritten. #
# #
# Copy this file into the repo .github/workflows folder and edit it based on #
# your needs to create a new workflow. Rename it to `publish.yaml`. #
################################################################################
name: Publish
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: The version to publish (without 'v', e.g. 1.0.0)
required: true
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.load_version.outputs.version }}
steps:
- name: Load version
id: load_version
run: |
if [ "$GITHUB_EVENT_NAME" = 'workflow_dispatch' ]
then
VERSION="${{ github.event.inputs.version }}"
else
if [ "$GITHUB_EVENT_NAME" = 'release' ]
then
TAG_NAME="${{ github.event.release.tag_name }}"
else
TAG_NAME="${{ github.ref }}"
fi
CLEAN_TAG=${TAG_NAME##*/}
VERSION=${CLEAN_TAG//v}
fi
echo "::set-output name=version::$VERSION"
publish:
needs: version
uses: ./.github/workflows/_npm_publish.yaml
with:
# access: public # For public packages
# buildBeforePublish: false # For packages that do not require a build step
version: ${{ needs.version.outputs.version }}
secrets:
githubAuthToken: ${{ secrets.REPO_ACCESS_TOKEN }}
# npmjsAuthToken: ${{ secrets.NPM_TOKEN }} # For public packages