# 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: Release new version

on:
  push:
    # Sequence of patterns matched against refs/heads
    branches:
      - 'staging/*'


jobs:
  PR-from-staging:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Set up Node
        uses: actions/setup-node@v1
        with:
          node-version: 14
          registry-url: https://registry.npmjs.org/
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: Set git user
        run: |
          git config --global user.email "github-action@users.noreply.github.com"
          git config --global user.name "GitHub Action"
      - name: Fetch beautifier/beautifier.io
        env:
          DEPLOY_KEY: ${{ secrets.BEAUTIFIER_IO_DEPLOY_KEY }}
          SSH_AUTH_SOCK: /tmp/ssh_agent.sock
        run: |
          mkdir -p ~/.ssh
          ssh-agent -a $SSH_AUTH_SOCK > /dev/null
          ssh-keyscan github.com >> ~/.ssh/known_hosts
          ssh-add - <<< "${DEPLOY_KEY}"
          git remote add site git@github.com:beautifier/beautifier.io.git
          git fetch --all
      - name: Install python twinE
        run: pip install twine        
      - name: Run release script for ${{ github.event.milestone.title }}
        env: 
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SSH_AUTH_SOCK: /tmp/ssh_agent.sock
          MILESTONE_VERSION: ${{ github.event.milestone.title }}
          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
          TWINE_USERNAME: ${{secrets.PYPI_USERNAME}} 
          TWINE_PASSWORD: ${{secrets.PYPI_PASSWORD}} 
        run: |
          ./tools/release-all.sh ${MILESTONE_VERSION}

Move default branch to main and use staging for release
Move default branch to main and use staging for release
