mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2024-12-13 05:55:33 +00:00
42 lines
976 B
YAML
42 lines
976 B
YAML
name: "publish-branch"
|
|
|
|
on:
|
|
workflow_dispatch
|
|
|
|
jobs:
|
|
npm-publish:
|
|
name: "Publish"
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Get branch name
|
|
run: |
|
|
BRANCH=${GITHUB_REF#refs/*/}
|
|
SANITIZED=$(echo "$BRANCH" | sed -e 's/[^a-zA-Z0-9-]/-/g')
|
|
echo "BRANCH_NAME=$SANITIZED" >> $GITHUB_ENV
|
|
### Set version
|
|
- name: Set version
|
|
run: npm version prerelease --no-git-tag-version --preid ${{ env.BRANCH_NAME }}-${{ github.run_number }}
|
|
|
|
### Publish to NPM registry
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '15'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- run: cat package.json
|
|
|
|
- run: npm i
|
|
- run: npm run build
|
|
|
|
- run: npm publish --access public --tag=beta
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|