Skip to content

3.2.4-alpha.2

3.2.4-alpha.2 #34

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Package
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node file to publish to npm
uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Update changelog
run: |
x=`printf "### ${{ github.event.release.name }} \n"; echo "${{ github.event.release.body }}"; printf '\n\n'; cat CHANGELOG.md`
echo "$x" > CHANGELOG.md
- name: Commit files
#if: false == true
id: commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git add --all
if [ -z "$(git status --porcelain)" ]; then
echo "::set-output name=push::false"
else
git commit -m "Updated Changelog" -a
echo "::set-output name=push::true"
fi
- name: Update Package Version
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git add --all
npm version ${{ github.event.release.tag_name }}
git tag -d ${{ github.event.release.tag_name }}
- name: Push changes
#if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: npm install
- name: Publish Beta to npm
if: github.event.release.prerelease == true
run: npm publish --tag=alpha --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm
if: github.event.release.prerelease == false
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}