added beta publish workflow
This commit is contained in:
parent
995e61e8a7
commit
5db7ce730e
2 changed files with 44 additions and 2 deletions
44
.github/workflows/publish-beta.yml
vendored
Normal file
44
.github/workflows/publish-beta.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
name: publish-and-tag
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- beta
|
||||||
|
jobs:
|
||||||
|
publish-to-npm:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: setup Node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
- name: install
|
||||||
|
run: npm install
|
||||||
|
- name: test
|
||||||
|
run: npm test
|
||||||
|
# Publish to npm if this version is not published
|
||||||
|
- name: publish
|
||||||
|
run: npm run publish:beta
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
||||||
|
create-tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: publish-to-npm
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
# Push tag to GitHub if package.json version's tag is not tagged
|
||||||
|
- name: package-version
|
||||||
|
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
|
||||||
|
- name: package-version-to-git-tag
|
||||||
|
uses: pkgdeps/git-tag-action@v2
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
github_repo: ${{ github.repository }}
|
||||||
|
version: ${{ env.PACKAGE_VERSION }}
|
||||||
|
git_commit_sha: ${{ github.sha }}
|
||||||
|
git_tag_prefix: "v"
|
|
@ -5,8 +5,6 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
tags:
|
|
||||||
- "!*"
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-to-npm:
|
publish-to-npm:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
Loading…
Reference in a new issue